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

add support for wildcard certificate #13

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kazuho
Copy link

@kazuho kazuho commented Apr 21, 2016

This PR adds support for wildcard certificates (note: only supports CN/dNSName that starts with *.).

It also

  • stops using strcasecmp to avoid locale-related issues
  • stops using str* functions for testing ASN1 strings (not guranteed to be terminated, see https://www.openssl.org/docs/man1.0.2/crypto/ASN1_STRING_length.html)
  • ignores . at the end of the supplied hostname if exists, so that for example supplied hostname www.example.com. matches against a certificate with CN=www.example.com

relates to #10

@nabla-c0d3
Copy link
Member

Hi,
Thanks for the pull request! Quick question before I look into this: OpenSSL (since 1.0.2) now provides its own function for validating hostnames (https://wiki.openssl.org/index.php/Hostname_validation ).
Any reason why you're not using it directly within h2o?
Thanks!

@kazuho
Copy link
Author

kazuho commented Apr 24, 2016

@nabla-c0d3 Thank you for the response.

Thanks for the pull request! Quick question before I look into this: OpenSSL (since 1.0.2) now provides its own function for validating hostnames (https://wiki.openssl.org/index.php/Hostname_validation ).
Any reason why you're not using it directly within h2o?

That is a good question. While OpenSSL 1.0.2 has the function, libressl does not, since it was forked before the function was added. In H2O, we recommend using libressl due to the fact that it supports CHAHA20-POLY1305; therefore we end up in having the need to have hostname verification implemented in some other way.

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.

2 participants