diff --git a/ghost/ghost.py b/ghost/ghost.py index f64ec11..dde96df 100644 --- a/ghost/ghost.py +++ b/ghost/ghost.py @@ -13,7 +13,7 @@ from PySide import QtWebKit from PySide.QtNetwork import QNetworkRequest, QNetworkAccessManager, \ QNetworkCookieJar, QNetworkDiskCache, \ - QNetworkProxy, QNetworkCookie + QNetworkProxy, QNetworkCookie, QSslConfiguration, QSsl from PySide import QtCore from PySide.QtCore import QSize, QByteArray, QUrl, QDateTime, \ QtCriticalMsg, QtDebugMsg, QtFatalMsg, \ @@ -27,7 +27,7 @@ from PyQt4 import QtWebKit from PyQt4.QtNetwork import QNetworkRequest, QNetworkAccessManager, \ QNetworkCookieJar, QNetworkDiskCache, \ - QNetworkProxy, QNetworkCookie + QNetworkProxy, QNetworkCookie, QSslConfiguration, QSsl from PyQt4 import QtCore from PyQt4.QtCore import QSize, QByteArray, QUrl, QDateTime, \ QtCriticalMsg, QtDebugMsg, QtFatalMsg, \ @@ -224,7 +224,7 @@ def __init__(self, user_agent=default_user_agent, wait_timeout=8, cache_dir=os.path.join(tempfile.gettempdir(), "ghost.py"), plugins_enabled=False, java_enabled=False, plugin_path=['/usr/lib/mozilla/plugins', ], - download_images=True, qt_debug=False, + download_images=True, qt_debug=False, no_sslv3 = True, show_scroolbars=True): self.http_resources = [] @@ -252,6 +252,15 @@ def __init__(self, user_agent=default_user_agent, wait_timeout=8, for p in plugin_path: Ghost._app.addLibraryPath(p) + + + if no_sslv3: + # enable tls1 only + old = QSslConfiguration.defaultConfiguration() + old.setProtocol(QSsl.TlsV1) + QSslConfiguration.setDefaultConfiguration(old) + + self.popup_messages = [] self.page = GhostWebPage(Ghost._app, self) QtWebKit.QWebSettings.setMaximumPagesInCache(0)