src/eric7/EricNetwork/EricSslUtilities.py

Tue, 16 Jan 2024 14:18:52 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 16 Jan 2024 14:18:52 +0100
branch
eric7
changeset 10503
6a37b6ac3928
parent 10439
21c28b0f9e41
child 11090
f5f5f5803935
permissions
-rw-r--r--

Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.

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

# Copyright (c) 2015 - 2024 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

    blocklist = [
        "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 blocklist and c.usedBits() >= 128
    ]
    defaultSslConfiguration = QSslConfiguration.defaultConfiguration()
    defaultSslConfiguration.setCiphers(strongCiphers)
    QSslConfiguration.setDefaultConfiguration(defaultSslConfiguration)

eric ide

mercurial