src/eric7/EricNetwork/EricSslUtilities.py

Thu, 07 Jul 2022 11:23:56 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 07 Jul 2022 11:23:56 +0200
branch
eric7
changeset 9209
b99e7fd55fd3
parent 8881
eric7/EricNetwork/EricSslUtilities.py@54e42bc2437a
child 9221
bf71ee032bb4
permissions
-rw-r--r--

Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".

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

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

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


def initSSL():
    """
    Function to initialize some global SSL stuff.
    """
    blacklist = [
        "SRP-AES-256-CBC-SHA",          # open to MitM
        "SRP-AES-128-CBC-SHA",          # open to MitM
    ]
    
    try:
        from PyQt6.QtNetwork import QSslConfiguration
    except ImportError:
        # no SSL available, so there is nothing to initialize
        return
    
    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