No class 'cryptography.x509.extensions.SubjectAlternativeName' extension was found

NaS886 edited April 4 in Python client

Most of the times when I try to generate a session with Kite, I am getting cryptography.x509 error. The problem is I am able to connect few times. However majority of the times I am getting this error. Following is the error output. Could anyone please let me know what is the issue here?

Thanks in advance.

data = kite.generate_session(request_token, api_secret=api_secret)
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1):
Traceback (most recent call last):

File "", line 1, in
data = kite.generate_session(request_token, api_secret=api_secret)

File "/home/pi/.local/lib/python3.7/site-packages/kiteconnect/", line 252, in generate_session
"checksum": checksum

File "/home/pi/.local/lib/python3.7/site-packages/kiteconnect/", line 821, in _post
return self._request(route, "POST", params)

File "/home/pi/.local/lib/python3.7/site-packages/kiteconnect/", line 865, in _request
raise e

File "/home/pi/.local/lib/python3.7/site-packages/kiteconnect/", line 862, in _request

File "/usr/lib/python3/dist-packages/requests/", line 60, in request
return session.request(method=method, url=url, **kwargs)

File "/usr/lib/python3/dist-packages/requests/", line 533, in request
resp = self.send(prep, **send_kwargs)

File "/usr/lib/python3/dist-packages/requests/", line 646, in send
r = adapter.send(request, **kwargs)

File "/usr/lib/python3/dist-packages/requests/", line 449, in send

File "/usr/lib/python3/dist-packages/urllib3/", line 600, in urlopen

File "/usr/lib/python3/dist-packages/urllib3/", line 343, in _make_request

File "/usr/lib/python3/dist-packages/urllib3/", line 841, in _validate_conn

File "/usr/lib/python3/dist-packages/urllib3/", line 355, in connect
cert = self.sock.getpeercert()

File "/usr/lib/python3/dist-packages/urllib3/contrib/", line 360, in getpeercert
'subjectAltName': get_subj_alt_name(x509)

File "/usr/lib/python3/dist-packages/urllib3/contrib/", line 211, in get_subj_alt_name

File "/home/pi/.local/lib/python3.7/site-packages/cryptography/x509/", line 131, in get_extension_for_class
"No {} extension was found".format(extclass), extclass.oid

ExtensionNotFound: No < class 'cryptography.x509.extensions.SubjectAlternativeName' > extension was found
Sign In or Register to comment.