16 "SRP-AES-256-CBC-SHA", # open to MitM |
16 "SRP-AES-256-CBC-SHA", # open to MitM |
17 "SRP-AES-128-CBC-SHA", # open to MitM |
17 "SRP-AES-128-CBC-SHA", # open to MitM |
18 ] |
18 ] |
19 |
19 |
20 try: |
20 try: |
21 from PyQt5.QtNetwork import QSslSocket |
21 from PyQt6.QtNetwork import QSslConfiguration |
22 except ImportError: |
22 except ImportError: |
23 # no SSL available, so there is nothing to initialize |
23 # no SSL available, so there is nothing to initialize |
24 return |
24 return |
25 |
25 |
26 strongCiphers = [c for c in QSslSocket.supportedCiphers() |
26 strongCiphers = [c for c in QSslConfiguration.supportedCiphers() |
27 if c.name() not in blacklist and c.usedBits() >= 128] |
27 if c.name() not in blacklist and c.usedBits() >= 128] |
28 QSslSocket.setDefaultCiphers(strongCiphers) |
28 defaultSslConfiguration = QSslConfiguration.defaultConfiguration() |
|
29 defaultSslConfiguration.setCiphers(strongCiphers) |
|
30 QSslConfiguration.setDefaultConfiguration(defaultSslConfiguration) |