src/eric7/EricNetwork/EricSslUtilities.py

Sun, 26 Feb 2023 12:44:03 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 26 Feb 2023 12:44:03 +0100
branch
mpy_network
changeset 9803
2ab3de60b51c
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
permissions
-rw-r--r--

MicroPython
- fixed an issue checking, if the device data is available

# -*- coding: utf-8 -*-

# Copyright (c) 2015 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing SSL utility functions.
"""


def initSSL():
    """
    Function to initialize some global SSL stuff.
    """
    try:
        from PyQt6.QtNetwork import QSslConfiguration  # __IGNORE_WARNING_I10__
    except ImportError:
        # no SSL available, so there is nothing to initialize
        return

    blacklist = [
        "SRP-AES-256-CBC-SHA",  # open to MitM
        "SRP-AES-128-CBC-SHA",  # open to MitM
    ]

    strongCiphers = [
        c
        for c in QSslConfiguration.supportedCiphers()
        if c.name() not in blacklist and c.usedBits() >= 128
    ]
    defaultSslConfiguration = QSslConfiguration.defaultConfiguration()
    defaultSslConfiguration.setCiphers(strongCiphers)
    QSslConfiguration.setDefaultConfiguration(defaultSslConfiguration)

eric ide

mercurial