eric7/E5Network/E5SslUtilities.py

branch
eric7
changeset 8312
800c432b34c8
parent 7923
91e843545d9a
child 8318
962bce857696
equal deleted inserted replaced
8311:4e8b98454baa 8312:800c432b34c8
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2015 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing SSL utility functions.
8 """
9
10
11 def initSSL():
12 """
13 Function to initialize some global SSL stuff.
14 """
15 blacklist = [
16 "SRP-AES-256-CBC-SHA", # open to MitM
17 "SRP-AES-128-CBC-SHA", # open to MitM
18 ]
19
20 try:
21 from PyQt5.QtNetwork import QSslSocket
22 except ImportError:
23 # no SSL available, so there is nothing to initialize
24 return
25
26 strongCiphers = [c for c in QSslSocket.supportedCiphers()
27 if c.name() not in blacklist and c.usedBits() >= 128]
28 QSslSocket.setDefaultCiphers(strongCiphers)

eric ide

mercurial