Skip to content
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

Kami
Copy link
Member

@Kami 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

cert_reqs=ssl.CERT_REQUIRED,
ca_certs=self.ca_cert,
ssl_version=libcloud.security.SSL_VERSION)
except Exception:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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

@asfgit asfgit merged commit b515b8f into apache:trunk Jan 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants