Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Change Default SSL Configuration #128

Open
wants to merge 1 commit into from

2 participants

@mattwoodyard

The default SSL configuration has problems negotiating the TLS bits on some sites. Setting TLSv1 as the only protocol choice, got alot more (at least the set I cared about) to work.

After a bit more investigation, I think the specific sets of MS IIS servers I'm hitting have cipher/protocol specs that are incompatible with the otherside. Anyways, no SSLv3 solves my problem, which for now is scraping some websites.

@mattwoodyard mattwoodyard Change Default SSL Configuration
The default SSL configuration has problems negotiating the TLS bits on some sites. Setting TLSv1 as the only protocol choice, got alot more (at least the set I cared about) to work.
5812463
@Kijewski

Maybe a new test case would be in order?

@myoffe myoffe referenced this pull request from a commit in BillGuard/Ghost.py
@myoffe myoffe Merge commit '58124632f6fb541c9f26dc601fcd4a2372c62d78'
Merge ssl fix from jeanphix#128

Conflicts:
	ghost/ghost.py
3ad75d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 3, 2013
  1. @mattwoodyard

    Change Default SSL Configuration

    mattwoodyard authored
    The default SSL configuration has problems negotiating the TLS bits on some sites. Setting TLSv1 as the only protocol choice, got alot more (at least the set I cared about) to work.
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 3 deletions.
  1. +12 −3 ghost/ghost.py
View
15 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)
Something went wrong with that request. Please try again.