fixed problems with tent.is and campr.me authentifications
This commit is contained in:
parent
a1e3816d0f
commit
ce3a42dbee
3 changed files with 19 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
from PyQt4 import QtCore, QtGui, QtWebKit
|
||||
import Helper, urllib, urllib2
|
||||
import Helper, urllib, urllib2, os
|
||||
|
||||
class Preferences:
|
||||
|
||||
|
@ -224,8 +224,10 @@ class Oauth:
|
|||
old_manager = self.auth_view.page().networkAccessManager()
|
||||
new_manager = Helper.NetworkAccessManager(old_manager, self.bungloo_callback)
|
||||
new_manager.authenticationRequired.connect(self.authentication_required)
|
||||
new_manager.sslErrors.connect(lambda reply, errors: self.handleSslErrors(reply, errors))
|
||||
self.auth_view.page().setNetworkAccessManager(new_manager)
|
||||
self.auth_view.show()
|
||||
|
||||
self.auth_view.load_url(url)
|
||||
return False
|
||||
|
||||
|
@ -250,6 +252,13 @@ class Oauth:
|
|||
if hasattr(self, "auth_view"):
|
||||
self.auth_view.hide()
|
||||
|
||||
def handleSslErrors(self, reply, errors):
|
||||
if os.name == "nt": # ignore SSL errors on Windows (yes a uggly workaround, don't know how to fix it yet)
|
||||
for error in errors:
|
||||
print error.errorString()
|
||||
reply.ignoreSslErrors(errors)
|
||||
|
||||
|
||||
|
||||
class Login(QtGui.QDialog):
|
||||
def __init__(self):
|
||||
|
|
Reference in a new issue