New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw a more friendly error message if establishing SSL / TLS connection fails #682

Merged
merged 9 commits into from Jan 14, 2016

Conversation

Projects
None yet
3 participants
@Kami
Member

Kami commented Jan 14, 2016

With this change we now throw a more user-friendly error message in case establishing SSL / TLS connection fails.

New error message:

  File "/home/kami/w/lc/libcloud/libcloud/httplib_ssl.py", line 312, in connect
    raise new_e
socket.error: Failed to establish SSL / TLS connection ([Errno 104] Connection reset by peer). It is possible that the server doesn't support requested SSL / TLS version (TLS v1.0).
For information on how to work around this issue, please see https://libcloud.readthedocs.org/en/latest/other/ssl-certificate-validation.html#changing-used-ssl-tls-version

Related to https://issues.apache.org/jira/browse/LIBCLOUD-791

Show outdated Hide outdated libcloud/httplib_ssl.py
cert_reqs=ssl.CERT_REQUIRED,
ca_certs=self.ca_cert,
ssl_version=libcloud.security.SSL_VERSION)
except Exception:

This comment has been minimized.

@jimbobhickville

jimbobhickville Jan 14, 2016

Contributor

Shouldn't we limit this to the specific exception type(s) that might exhibit this behavior? Looked like it was socket.error in the JIRA.

@jimbobhickville

jimbobhickville Jan 14, 2016

Contributor

Shouldn't we limit this to the specific exception type(s) that might exhibit this behavior? Looked like it was socket.error in the JIRA.

This comment has been minimized.

@Kami

Kami Jan 14, 2016

Member

Yeah, that's a good idea - I will make that change.

@Kami

Kami Jan 14, 2016

Member

Yeah, that's a good idea - I will make that change.

This comment has been minimized.

@Kami

Kami Jan 14, 2016

Member

Done.

Also committed some tests (previously I forgot to add the test file).

@Kami

Kami Jan 14, 2016

Member

Done.

Also committed some tests (previously I forgot to add the test file).

@asfgit asfgit merged commit b515b8f into apache:trunk Jan 14, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment