Added code to limit SSL sockets to ciphers with at least 128 bits for Qt < 5.3.0.

Sat, 18 Jul 2015 15:14:28 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 18 Jul 2015 15:14:28 +0200
changeset 4317
0de465a93200
parent 4316
493891cbacee
child 4318
c2f374ca452b

Added code to limit SSL sockets to ciphers with at least 128 bits for Qt < 5.3.0.

APIs/Python3/eric6.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric6.E5Network.E5SslUtilities.html file | annotate | diff | comparison | revisions
Documentation/Source/index-eric6.E5Network.html file | annotate | diff | comparison | revisions
E5Network/E5SslUtilities.py file | annotate | diff | comparison | revisions
Helpviewer/HelpWindow.py file | annotate | diff | comparison | revisions
Helpviewer/Network/NetworkAccessManager.py file | annotate | diff | comparison | revisions
eric6.e4p file | annotate | diff | comparison | revisions
eric6.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric6.api	Sat Jul 18 10:36:53 2015 +0200
+++ b/APIs/Python3/eric6.api	Sat Jul 18 15:14:28 2015 +0200
@@ -1696,6 +1696,7 @@
 eric6.E5Network.E5SslInfoWidget.E5SslInfoWidget.accept?4()
 eric6.E5Network.E5SslInfoWidget.E5SslInfoWidget.showAt?4(pos)
 eric6.E5Network.E5SslInfoWidget.E5SslInfoWidget?1(url, configuration, parent=None)
+eric6.E5Network.E5SslUtilities.initSSL?4()
 eric6.E5Network.E5UrlInfo.E5UrlInfo.ExeGroup?7
 eric6.E5Network.E5UrlInfo.E5UrlInfo.ExeOther?7
 eric6.E5Network.E5UrlInfo.E5UrlInfo.ExeOwner?7
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sat Jul 18 10:36:53 2015 +0200
+++ b/Documentation/Help/source.qhp	Sat Jul 18 15:14:28 2015 +0200
@@ -161,6 +161,7 @@
             <section title="eric6.E5Network.E5SslCertificatesInfoWidget" ref="eric6.E5Network.E5SslCertificatesInfoWidget.html" />
             <section title="eric6.E5Network.E5SslErrorHandler" ref="eric6.E5Network.E5SslErrorHandler.html" />
             <section title="eric6.E5Network.E5SslInfoWidget" ref="eric6.E5Network.E5SslInfoWidget.html" />
+            <section title="eric6.E5Network.E5SslUtilities" ref="eric6.E5Network.E5SslUtilities.html" />
             <section title="eric6.E5Network.E5UrlInfo" ref="eric6.E5Network.E5UrlInfo.html" />
             <section title="eric6.E5Network.E5XmlRpcClient" ref="eric6.E5Network.E5XmlRpcClient.html" />
           </section>
@@ -3968,6 +3969,7 @@
       <keyword name="E5SslInfoWidget.__showCertificateInfos" id="E5SslInfoWidget.__showCertificateInfos" ref="eric6.E5Network.E5SslInfoWidget.html#E5SslInfoWidget.__showCertificateInfos" />
       <keyword name="E5SslInfoWidget.accept" id="E5SslInfoWidget.accept" ref="eric6.E5Network.E5SslInfoWidget.html#E5SslInfoWidget.accept" />
       <keyword name="E5SslInfoWidget.showAt" id="E5SslInfoWidget.showAt" ref="eric6.E5Network.E5SslInfoWidget.html#E5SslInfoWidget.showAt" />
+      <keyword name="E5SslUtilities (Module)" id="E5SslUtilities (Module)" ref="eric6.E5Network.E5SslUtilities.html" />
       <keyword name="E5StringListCompleter" id="E5StringListCompleter" ref="eric6.E5Gui.E5Completers.html#E5StringListCompleter" />
       <keyword name="E5StringListCompleter (Constructor)" id="E5StringListCompleter (Constructor)" ref="eric6.E5Gui.E5Completers.html#E5StringListCompleter.__init__" />
       <keyword name="E5StringListEditWidget" id="E5StringListEditWidget" ref="eric6.E5Gui.E5StringListEditWidget.html#E5StringListEditWidget" />
@@ -13486,6 +13488,7 @@
       <keyword name="initGlobals" id="initGlobals" ref="eric6.uninstall.html#initGlobals" />
       <keyword name="initPreferences" id="initPreferences" ref="eric6.Preferences.__init__.html#initPreferences" />
       <keyword name="initRecentSettings" id="initRecentSettings" ref="eric6.Preferences.__init__.html#initRecentSettings" />
+      <keyword name="initSSL" id="initSSL" ref="eric6.E5Network.E5SslUtilities.html#initSSL" />
       <keyword name="initService" id="initService" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html#initService" />
       <keyword name="initService" id="initService" ref="eric6.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html#initService" />
       <keyword name="initService" id="initService" ref="eric6.Plugins.CheckerPlugins.SyntaxChecker.jsCheckSyntax.html#initService" />
@@ -13913,6 +13916,7 @@
       <file>eric6.E5Network.E5SslCertificatesInfoWidget.html</file>
       <file>eric6.E5Network.E5SslErrorHandler.html</file>
       <file>eric6.E5Network.E5SslInfoWidget.html</file>
+      <file>eric6.E5Network.E5SslUtilities.html</file>
       <file>eric6.E5Network.E5UrlInfo.html</file>
       <file>eric6.E5Network.E5XmlRpcClient.html</file>
       <file>eric6.E5XML.Config.html</file>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Documentation/Source/eric6.E5Network.E5SslUtilities.html	Sat Jul 18 15:14:28 2015 +0200
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html><head>
+<title>eric6.E5Network.E5SslUtilities</title>
+<meta charset="UTF-8">
+<style>
+body {
+    background: #EDECE6;
+    margin: 0em 1em 10em 1em;
+    color: black;
+}
+
+h1 { color: white; background: #85774A; }
+h2 { color: white; background: #85774A; }
+h3 { color: white; background: #9D936E; }
+h4 { color: white; background: #9D936E; }
+    
+a { color: #BA6D36; }
+
+</style>
+</head>
+<body><a NAME="top" ID="top"></a>
+<h1>eric6.E5Network.E5SslUtilities</h1>
+<p>
+Module implementing SSL utility functions.
+</p>
+<h3>Global Attributes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Classes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Functions</h3>
+<table>
+<tr>
+<td><a href="#initSSL">initSSL</a></td>
+<td>Function to initialize some global SSL stuff.</td>
+</tr>
+</table>
+<hr /><hr />
+<a NAME="initSSL" ID="initSSL"></a>
+<h2>initSSL</h2>
+<b>initSSL</b>(<i></i>)
+<p>
+    Function to initialize some global SSL stuff.
+</p>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+</body></html>
\ No newline at end of file
--- a/Documentation/Source/index-eric6.E5Network.html	Sat Jul 18 10:36:53 2015 +0200
+++ b/Documentation/Source/index-eric6.E5Network.html	Sat Jul 18 15:14:28 2015 +0200
@@ -55,6 +55,9 @@
 <td><a href="eric6.E5Network.E5SslInfoWidget.html">E5SslInfoWidget</a></td>
 <td>Module implementing a widget to show SSL information.</td>
 </tr><tr>
+<td><a href="eric6.E5Network.E5SslUtilities.html">E5SslUtilities</a></td>
+<td>Module implementing SSL utility functions.</td>
+</tr><tr>
 <td><a href="eric6.E5Network.E5UrlInfo.html">E5UrlInfo</a></td>
 <td>Module implementing a class replacing QUrlInfo.</td>
 </tr><tr>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/E5Network/E5SslUtilities.py	Sat Jul 18 15:14:28 2015 +0200
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2015 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing SSL utility functions.
+"""
+
+from PyQt5.QtCore import qVersion
+
+def initSSL():
+    """
+    Function to initialize some global SSL stuff.
+    """
+    if qVersion() < "5.3.0":
+        # Qt 5.3.0 and newer don't use weak ciphers anymore
+        try:
+            from PyQt5.QtNetwork import QSslSocket
+        except ImportError:
+            # no SSL available, so there is nothing to initialize
+            return
+        
+        strongCiphers = [c for c in QSslSocket.supportedCiphers()
+                         if c.usedBits() >= 128]
+        QSslSocket.setDefaultCiphers(strongCiphers)
--- a/Helpviewer/HelpWindow.py	Sat Jul 18 10:36:53 2015 +0200
+++ b/Helpviewer/HelpWindow.py	Sat Jul 18 15:14:28 2015 +0200
@@ -135,6 +135,10 @@
             if not self.fromEric:
                 self.setStyle(Preferences.getUI("Style"),
                               Preferences.getUI("StyleSheet"))
+                
+                # initialize some SSL stuff
+                from E5Network.E5SslUtilities import initSSL
+                initSSL()
             
             if self.useQtHelp:
                 self.__helpEngine = \
--- a/Helpviewer/Network/NetworkAccessManager.py	Sat Jul 18 10:36:53 2015 +0200
+++ b/Helpviewer/Network/NetworkAccessManager.py	Sat Jul 18 15:14:28 2015 +0200
@@ -185,6 +185,7 @@
         # Do Not Track feature
         if self.__doNotTrack:
             req.setRawHeader("DNT", "1")
+            req.setRawHeader("X-Do-Not-Track", "1")
         
         # Send referer header?
         if not self.__sendReferer and \
--- a/eric6.e4p	Sat Jul 18 10:36:53 2015 +0200
+++ b/eric6.e4p	Sat Jul 18 15:14:28 2015 +0200
@@ -200,6 +200,7 @@
     <Source>E5Network/E5SslCertificatesInfoWidget.py</Source>
     <Source>E5Network/E5SslErrorHandler.py</Source>
     <Source>E5Network/E5SslInfoWidget.py</Source>
+    <Source>E5Network/E5SslUtilities.py</Source>
     <Source>E5Network/E5UrlInfo.py</Source>
     <Source>E5Network/E5XmlRpcClient.py</Source>
     <Source>E5Network/__init__.py</Source>
--- a/eric6.py	Sat Jul 18 10:36:53 2015 +0200
+++ b/eric6.py	Sat Jul 18 15:14:28 2015 +0200
@@ -294,6 +294,10 @@
     # Load translation files and install them
     loc = Startup.loadTranslators(qt4TransDir, app, ("qscintilla",))
     
+    # Initialize SSL stuff
+    from E5Network.E5SslUtilities import initSSL
+    initSSL()
+    
     splash.showMessage(QCoreApplication.translate("eric6", "Starting..."))
     # We can only import these after creating the E5Application because they
     # make Qt calls that need the E5Application to exist.

eric ide

mercurial