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

x509-validation rejects valid wildcard certs #38

Closed
wereHamster opened this issue Dec 7, 2014 · 2 comments
Closed

x509-validation rejects valid wildcard certs #38

wereHamster opened this issue Dec 7, 2014 · 2 comments

Comments

@wereHamster
Copy link

I have a wildcard certificate for *.xxx.xx and it is rejected when matched against aaa.xxx.xx. The relevant code is in x509-validation/Data/X509/Validation.hs:

wildcardMatch l
            -- <star>.com or <star> is always invalid
            | length l < 2 = [InvalidWildcard]
            -- some TLD like .uk got small subTLD like (.co.uk), and we don't want to accept *.co.uk
            | length (head l) <= 2 && length (head $ drop 1 l) <= 3 && length l < 3 = [InvalidWildcard]
            | l == take (length l) (reverse $ splitDot fqhn) = [] -- success: we got a match
            | otherwise                                      = [NameMismatch fqhn]

There are many two-characters TLDs under which ordinary people can register three-letter domains.

@wereHamster
Copy link
Author

You should use this to decide what suffix to allow: https://publicsuffix.org

@wereHamster
Copy link
Author

Apparently the PSL should not be used. See #60.

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 a pull request may close this issue.

1 participant