-
Notifications
You must be signed in to change notification settings - Fork 498
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
Add support for parsing common/alt names #63
Conversation
This appears to follow both the specification and browser behaviour, but this should be double-checked before merge.
Crap, 5.2 support. Working on this now. |
Tests are now passing completely, but 5.2 requires some manual testing here, since Travis skips them (it doesn't have OpenSSL enabled, alas). I'll attempt this tomorrow if no one beats me to it. :) |
Also to test: self-signed certificates. They should be handled by the built in verification, but we should formalise this with a test. |
Does not support IP address certificates, possibly vulnerable to MITM attacks with those? (CN = google.com, subjectAltName = IP: 127.0.0.1) |
Two thoughts about the wildcard matching.
|
Some of the test cases have no assertions. |
Handled by the
@dd32 used regular expressions for this in the WP port, I'll switch to doing the same.
Without using the public suffix list and doing extra validation, can't really catch this. Also IMO a problem for the upstream CAs; if they want to issue a certificate for *.com, that's their policy (although I'd expect to see them dropped from the bundle). Thanks for the feedback! 🍰 |
Oh, oops. Nice :) |
Originally I was using a regular expression for matching, but switched it to only allowing .example.com, no f.com funkyness. |
Noted. I'm wary of allowing f*.com personally, lest it gets exploited. |
For reference, all implementations of Firefox (NSS for desktop versions and httpclientandroidlib on Android) allow f*.com, but only with the wildcard as the final character. They also only allow them for >3 components, as per the following comment from NSS:
I'm happy with those restrictions for Requests. |
To complete before merging:
|
This makes it easier to test, as it means we don't need to test against live APIs.
Fixes an obscure bug with OpenSSL 0.9.8j and lower. Props @dd32, see http://core.trac.wordpress.org/changeset/25569 for prior art.
This appears to follow both the specification and browser behaviour, but this should be double-checked before merge.
Pinging @mdawaffe for a review on this. Appears to follow both the RFC and Firefox's implementation.
Notably, doesn't support double wildcards (
*.*.x.com
), but I'm not sure that browsers support this any more. Google has migrated away from it for App Engine, I believe due to browser support.