Closed JoffJones closed 3 years ago
Hi there! Thanks for making this great tool. I am having similar problems to those mentioned before where the interaction with the web services isn't being authenticated (https://github.com/shahinrostami/chord/issues/20).
Is there a workaround for the latest version?
Many thanks,
Joff
Hi Joff
I'm glad you like it.
Can you share an error and some more details?
The feature of having it work through a secured work/school network is tricky as I can't reproduce it on my end, and there is little funding to work with on this project!
Thank you for the quick response! Its the SSL certificate verification error referred to in previous posts. I've copied the full error below:
from chord import Chord Chord(eg_mat, ['b', 'a']).show()
SSLCertVerificationError Traceback (most recent call last) ~/.conda/envs/networks/lib/python3.8/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 698 # Make the request on the httplib connection object. --> 699 httplib_response = self._make_request( 700 conn,
~/.conda/envs/networks/lib/python3.8/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw) 381 try: --> 382 self._validate_conn(conn) 383 except (SocketTimeout, BaseSSLError) as e:
~/.conda/envs/networks/lib/python3.8/site-packages/urllib3/connectionpool.py in _validate_conn(self, conn)
1009 if not getattr(conn, "sock", None): # AppEngine might not have .sock
-> 1010 conn.connect()
1011
~/.conda/envs/networks/lib/python3.8/site-packages/urllib3/connection.py in connect(self) 410 --> 411 self.sock = ssl_wrap_socket( 412 sock=conn,
~/.conda/envs/networks/lib/python3.8/site-packages/urllib3/util/ssl_.py in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls) 427 if send_sni: --> 428 ssl_sock = _ssl_wrap_socket_impl( 429 sock, context, tls_in_tls, server_hostname=server_hostname
~/.conda/envs/networks/lib/python3.8/site-packages/urllib3/util/ssl_.py in _ssl_wrap_socket_impl(sock, ssl_context, tls_in_tls, server_hostname) 471 if server_hostname: --> 472 return ssl_context.wrap_socket(sock, server_hostname=server_hostname) 473 else:
~/.conda/envs/networks/lib/python3.8/ssl.py in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session) 499 # ctx._wrap_socket() --> 500 return self.sslsocket_class._create( 501 sock=sock,
~/.conda/envs/networks/lib/python3.8/ssl.py in _create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session) 1039 raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets") -> 1040 self.do_handshake() 1041 except (OSError, ValueError):
~/.conda/envs/networks/lib/python3.8/ssl.py in do_handshake(self, block) 1308 self.settimeout(None) -> 1309 self._sslobj.do_handshake() 1310 finally:
SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1124)
During handling of the above exception, another exception occurred:
MaxRetryError Traceback (most recent call last) ~/.conda/envs/networks/lib/python3.8/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies) 438 if not chunked: --> 439 resp = conn.urlopen( 440 method=request.method,
~/.conda/envs/networks/lib/python3.8/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 754 --> 755 retries = retries.increment( 756 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
~/.conda/envs/networks/lib/python3.8/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace) 572 if new_retry.is_exhausted(): --> 573 raise MaxRetryError(_pool, url, error or ResponseError(cause)) 574
MaxRetryError: HTTPSConnectionPool(host='api.shahin.dev', port=443): Max retries exceeded with url: /chordfree (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1124)')))
During handling of the above exception, another exception occurred:
SSLError Traceback (most recent call last)
@JoffJones Thanks for pasting that over. Does this work https://stackoverflow.com/a/43855394/29445 ?
@JoffJones in the meantime, I've just added verify_ssl=False
to Chord!
pip uninstall chord
and then pip install chord
to update to 1.0.2
!
@shahinrostami thank you very much for the quick fix! I managed to get it working but unfortunately during testing I hit the limit on number of requests made using the free version
@shahinrostami thank you very much for the quick fix! I managed to get it working but unfortunately during testing I hit the limit on number of requests made using the free version
Ah, I just noticed you said you got it working! Glad it works.
Hi there! Thanks for making this great tool. I am having similar problems to those mentioned before where the interaction with the web services isn't being authenticated (https://github.com/shahinrostami/chord/issues/20).
Is there a workaround for the latest version?
Many thanks, Joff