Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Default SSL Configuration #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions ghost/ghost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand All @@ -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, \
Expand Down Expand Up @@ -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 = []

Expand Down Expand Up @@ -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)
Expand Down