Switch to new API for SSL ciphers
This got moved to QSslConfiguration in Qt 5.5: https://codereview.qt-project.org/c/qt/qtbase/+/113886 (92cda9474245c79b635c21cd140c5d0a3a6d2e5b in qtbase) (cherry picked from commit 317da1e3cf23bf40d24d186cd6d06b6bc9a09958)
This commit is contained in:
parent
ca4d25b203
commit
3bced54404
|
|
@ -25,7 +25,7 @@ import dataclasses
|
|||
from typing import TYPE_CHECKING, Dict, MutableMapping, Optional, Set
|
||||
|
||||
from PyQt5.QtCore import pyqtSlot, pyqtSignal, QUrl, QByteArray
|
||||
from PyQt5.QtNetwork import (QNetworkAccessManager, QNetworkReply, QSslSocket,
|
||||
from PyQt5.QtNetwork import (QNetworkAccessManager, QNetworkReply, QSslConfiguration,
|
||||
QNetworkProxy)
|
||||
|
||||
from qutebrowser.config import config
|
||||
|
|
@ -103,7 +103,8 @@ def _is_secure_cipher(cipher):
|
|||
|
||||
def init():
|
||||
"""Disable insecure SSL ciphers on old Qt versions."""
|
||||
default_ciphers = QSslSocket.defaultCiphers()
|
||||
config = QSslConfiguration.defaultConfiguration()
|
||||
default_ciphers = config.ciphers()
|
||||
log.init.vdebug( # type: ignore[attr-defined]
|
||||
"Default Qt ciphers: {}".format(
|
||||
', '.join(c.name() for c in default_ciphers)))
|
||||
|
|
@ -119,7 +120,7 @@ def init():
|
|||
if bad_ciphers:
|
||||
log.init.debug("Disabling bad ciphers: {}".format(
|
||||
', '.join(c.name() for c in bad_ciphers)))
|
||||
QSslSocket.setDefaultCiphers(good_ciphers)
|
||||
config.setCiphers(good_ciphers)
|
||||
|
||||
|
||||
_SavedErrorsType = MutableMapping[
|
||||
|
|
|
|||
Loading…
Reference in New Issue