lcl: Make RC4 hack less bad
* Don't add RC4 every time we init the class, since it's a global variable. * Don't crash if pyopenssl isn't available. fixes #2000
This commit is contained in:
parent
5ef6b8a346
commit
7a8aa783df
1 changed files with 3 additions and 2 deletions
|
|
@ -61,11 +61,12 @@ class LCLBrowser(LoginBrowser):
|
||||||
TIMEOUT = 30.0
|
TIMEOUT = 30.0
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
requests.packages.urllib3.contrib.pyopenssl.DEFAULT_SSL_CIPHER_LIST += ':RC4'
|
if hasattr(requests.packages.urllib3.contrib, 'pyopenssl') \
|
||||||
|
and ':RC4' not in requests.packages.urllib3.contrib.pyopenssl.DEFAULT_SSL_CIPHER_LIST:
|
||||||
|
requests.packages.urllib3.contrib.pyopenssl.DEFAULT_SSL_CIPHER_LIST += ':RC4'
|
||||||
|
|
||||||
super(LCLBrowser, self).__init__(*args, **kwargs)
|
super(LCLBrowser, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def do_login(self):
|
def do_login(self):
|
||||||
assert isinstance(self.username, basestring)
|
assert isinstance(self.username, basestring)
|
||||||
assert isinstance(self.password, basestring)
|
assert isinstance(self.password, basestring)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue