E5Network/E5SslUtilities.py

Sat, 18 Jul 2015 16:50:24 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 18 Jul 2015 16:50:24 +0200
changeset 4318
c2f374ca452b
parent 4317
0de465a93200
child 4332
64034d85c709
permissions
-rw-r--r--

Improved parsing of the content disposition header analog to the way it is done in qutebrowser.

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

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

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

from __future__ import unicode_literals

from PyQt5.QtCore import qVersion

def initSSL():
    """
    Function to initialize some global SSL stuff.
    """
    if qVersion() < "5.3.0":
        # Qt 5.3.0 and newer don't use weak ciphers anymore
        try:
            from PyQt5.QtNetwork import QSslSocket
        except ImportError:
            # no SSL available, so there is nothing to initialize
            return
        
        strongCiphers = [c for c in QSslSocket.supportedCiphers()
                         if c.usedBits() >= 128]
        QSslSocket.setDefaultCiphers(strongCiphers)

eric ide

mercurial