eric6/E5Network/E5SslUtilities.py

changeset 6942
2602857055c5
parent 6645
ad476851d7e0
child 7229
53054eb5b15a
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2015 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing SSL utility functions.
8 """
9
10 from __future__ import unicode_literals
11
12
13 def initSSL():
14 """
15 Function to initialize some global SSL stuff.
16 """
17 blacklist = [
18 "SRP-AES-256-CBC-SHA", # open to MitM
19 "SRP-AES-128-CBC-SHA", # open to MitM
20 ]
21
22 try:
23 from PyQt5.QtNetwork import QSslSocket
24 except ImportError:
25 # no SSL available, so there is nothing to initialize
26 return
27
28 strongCiphers = [c for c in QSslSocket.supportedCiphers()
29 if c.name() not in blacklist and c.usedBits() >= 128]
30 QSslSocket.setDefaultCiphers(strongCiphers)

eric ide

mercurial