Merge branch 'master' of ssh://tonks/qutebrowser

This commit is contained in:
Florian Bruhin 2015-01-28 08:43:48 +01:00
commit 1526cf1532
2 changed files with 35 additions and 27 deletions

View File

@ -152,6 +152,7 @@ class NetworkManager(QNetworkAccessManager):
request.deleteLater()
self.shutting_down.emit()
if SSL_AVAILABLE:
@pyqtSlot('QNetworkReply*', 'QList<QSslError>')
def on_ssl_errors(self, reply, errors):
"""Decide if SSL errors should be ignored or not.
@ -164,10 +165,10 @@ class NetworkManager(QNetworkAccessManager):
"""
ssl_strict = config.get('network', 'ssl-strict')
if ssl_strict == 'ask':
err_string = '\n'.join('- ' + err.errorString() for err in errors)
answer = self._ask('SSL errors - continue?\n{}'.format(err_string),
mode=usertypes.PromptMode.yesno,
owner=reply)
err_string = '\n'.join('- ' + err.errorString() for err in
errors)
answer = self._ask('SSL errors - continue?\n{}'.format(
err_string), mode=usertypes.PromptMode.yesno, owner=reply)
if answer:
reply.ignoreSslErrors()
elif ssl_strict:

View File

@ -29,7 +29,10 @@ import collections
from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, qVersion
from PyQt5.QtWebKit import qWebKitVersion
from PyQt5.QtNetwork import QSslSocket
try:
from PyQt5.QtNetwork import QSslSocket
except ImportError:
QSslSocket = None
import qutebrowser
from qutebrowser.utils import log, utils
@ -206,11 +209,15 @@ def version():
'PyQt: {}'.format(PYQT_VERSION_STR),
]
lines += _module_versions()
if QSslSocket is not None and QSslSocket.supportsSsl():
ssl_version = QSslSocket.sslLibraryVersionString()
else:
ssl_version = 'unavailable'
lines += [
'Webkit: {}'.format(qWebKitVersion()),
'Harfbuzz: {}'.format(os.environ.get('QT_HARFBUZZ', 'system')),
'SSL: {}'.format(QSslSocket.sslLibraryVersionString() if
QSslSocket.supportsSsl() else 'unavailable'),
'SSL: {}'.format(ssl_version),
'',
'Frozen: {}'.format(hasattr(sys, 'frozen')),
'Platform: {}, {}'.format(platform.platform(),