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

support for newer SSL certificate types #188

Merged
merged 1 commit into from
Apr 4, 2014

Conversation

pilif
Copy link
Contributor

@pilif pilif commented Apr 3, 2014

More and more CAs (also internal ones, possibly most commonly used with logstash-forwarder) are using certificates signed using SHA256 or SHA512, whereas go's X.509 support by default only supports certificates signed with a SHA1 hash.

This leads to logstash-forwarder failing with

Failed to tls handshake with xxx.xxx.xxx.xxx x509: certificate signed by unknown authority (possibly because of "x509: cannot verify signature: algorithm unimplemented" while trying to verify candidate authority certificate "Name of the Authority")

The error message isn't very helpful and even if users were capable of easily finding out where the problem is, you can't expect a CA to provide their certificate signed with a different hash, so IMHO these newer certificates should be supported.

Thankfully, supporting them is reduced to importing the two hash functions before connecting.

more and more CAs are using certificates signed using SHA256 or SHA512,
whereas go's X.509 support by default only supports certificates signed
with a SHA1 hash.

Importing the two hashes causes them to be registered and available to
use for x509 which in turn allows connecting to servers using one of
these newer certificates
@driskell
Copy link
Contributor

driskell commented Apr 3, 2014

I think it'll be preferred for the imports to be combined into the main import bracket at the top. Other than that good spot and fix :)

@driskell
Copy link
Contributor

driskell commented Apr 3, 2014

Nevermind I see this is unused import so the underscore stops that? Learn something new all the time :) Apologies.

@pilif
Copy link
Contributor Author

pilif commented Apr 3, 2014

Yeah. The underscore is needed for the compiler to be happy.

I don't like how importing the file has such wide-ranging side effects, especially considering the fact that the compiler really dislikes unused imports.

But that's how the official API works, so that's what we have to put up with :-)

@jordansissel
Copy link
Contributor

Seems like a harmless bugfix. Merging!

jordansissel added a commit that referenced this pull request Apr 4, 2014
support for newer SSL certificate types
@jordansissel jordansissel merged commit ec50479 into elastic:master Apr 4, 2014
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.

3 participants