Issue2486
Created on 2016-03-17.13:15:23 by pradeeppanayal, last changed 2018-03-22.08:07:36 by jeff.allen.
msg10822 (view) |
Author: pradeeppanayal (pradeeppanayal) |
Date: 2016-03-17.13:15:21 |
|
I am getting the ssl illegal state exception frequently but not always.
I am using jsonrpc lib with an added wrapper to the method " _request" as follows
@trust_all_certificates
def _request(self, methodname, params, rpcid=None):
request = dumps(params, methodname, encoding=self.__encoding,
rpcid=rpcid, version=self.__version)
response = self._run_request(request)
check_for_errors(response)
return response['result']
and the wrapper is taken from : http://tech.pedersen-live.com/2010/10/trusting-all-certificates-in-jython/ as follows,
def trust_all_certificates(f):
'''Decorator function that will make it so the context of the decorated method
will run with our TrustManager that accepts all certificates'''
def wrapped(*args, **kwargs):
# Only do this if running under Jython
if 'java' in sys.platform:
from javax.net.ssl import SSLContext
SSLContext.setDefault(TRUST_ALL_CONTEXT)
try:
res = f(*args, **kwargs)
return res
finally:
SSLContext.setDefault(DEFAULT_CONTEXT)
else:
return f(*args, **kwargs)
return wrapped
|
msg10844 (view) |
Author: Jim Baker (zyasoft) |
Date: 2016-04-27.21:46:09 |
|
Possibly related to #2462
|
msg10947 (view) |
Author: Jim Baker (zyasoft) |
Date: 2016-09-08.23:42:18 |
|
Is this still a problem, given the fix in #2462?
|
|
Date |
User |
Action |
Args |
2018-03-22 08:07:36 | jeff.allen | set | priority: normal milestone: Jython 2.7.0 -> |
2016-09-08 23:42:18 | zyasoft | set | messages:
+ msg10947 |
2016-04-27 21:46:10 | zyasoft | set | nosy:
+ zyasoft messages:
+ msg10844 |
2016-03-17 13:15:23 | pradeeppanayal | create | |
|