Wildcard SSL on sub-subdomain

97,102

Solution 1

A wildcard SSL certificate for *.example.net will match sub.example.net but not sub.sub.example.net.

From RFC 2818:

Matching is performed using the matching rules specified by RFC2459. If more than one identity of a given type is present in the certificate (e.g., more than one dNSName name, a match in any one of the set is considered acceptable.) Names may contain the wildcard character * which is considered to match any single domain name component or component fragment. E.g., *.a.example matches foo.a.example but not bar.foo.a.example. f*.example matches foo.example but not bar.example.

Solution 2

If you need a wildcard certificate that contains *.domain.example sites and also work with sub1.sub2.domain.example or another domain like *.domain2.example, you can solve that with a single wildcard certificate with what is called a subject alternative name (SAN) extension for each of the other sub sub domains. A SAN cert is not just for multiple specific host names, it can be created for wildcards entries as well.

For example, *.domain.example, sub1.sub2.domain.example, and *.domain2.example would have a Common Name of *.domain.example then you would attach a subject alternative name of both *.domain2.example and *.sub2.domain.example. It might depend on the Certificate Authority as to how they would charge you (or not) for the certificate, but there are some out there where this offering is available. Also, SAN is support is pretty widespread in the web browser space. The best real world example of this use, it Google's SSL cert. Go open Google and view its SSL certificate, you will see it works for *.google.com, *.youtube.com, *.gmail.com, and a bunch more where they are listed as subject alternative names.

Solution 3

The wildcard is only applied to the first part (from the left) of you domain. So you'll need a certificate for *.sub2.domain.example

If you meant that you have sub1.domain.example and sub2.domain.example, then it should work.

Share:
97,102

Related videos on Youtube

porto alet
Author by

porto alet

Updated on August 08, 2021

Comments

  • porto alet
    porto alet almost 3 years

    We have a wildcard SSL certificate for *.domain.com, and have a website with sub1.sub2.domain.com.

    Safari 4.0.4 on MacOS pops up a certificate error(presumably because of wildcard interpretation), while Safari 4 on windows does not.

    Also IE8 behavior is mixed at best, some IE8 display the certificate error and some do not.

    What causes this strange behavior on Safari and IE?

    • Rafa
      Rafa about 12 years
      just realized of this problem after buying a new 2-year certificate...
  • Admin
    Admin over 11 years
    @Chris I don't think so, there are various technical factors that restrict such rule and forced Certificate authorities to develop security certificate accordingly.
  • Chris Marisic
    Chris Marisic over 11 years
    @sophie various technical factors, like someone realized it's more profitable to sell infinity certificates than to allow 1 certificate to cover every single scenario to infinity.
  • Lyndsy Simon
    Lyndsy Simon over 11 years
    @ChrisMarisic Respectfully, that's silly. If that were the case, what would be the point of certs in the first place?
  • Arto Bendiken
    Arto Bendiken over 10 years
    What are examples of CAs who would issue such certificates?
  • Simon East
    Simon East about 10 years
    So would it be possible to get a certificate for *.DOMAIN.COM that has a SAN for *.*.DOMAIN.COM (and possibly *.*.*.DOMAIN.COM) to cover these sub-subdomains and sub-sub-subdomains?
  • Carl
    Carl about 10 years
    See blackhat.com/presentations/bh-dc-09/Marlinspike/… slide 91 for a possible security threat with wildcard certificates. Also see media.blackhat.com/bh-ad-10/Hansen/… slide 38.
  • iconoclast
    iconoclast about 10 years
    @user1602478: what are those technical factors?
  • sdaffa23fdsf
    sdaffa23fdsf almost 9 years
    This was clarified in RFC 6125 Section 6.4.3. Checking of Wildcard Certificates
  • Eamon Nerbonne
    Eamon Nerbonne over 8 years
    @MartynChamberlin you should be happy, some questions aren't just closed, they're locked with highly misleading information. Good luck resolving your issues then...
  • Shane Rowatt
    Shane Rowatt over 8 years
    can you have *.*.example.com to secure first and second level sub-domains?
  • Nick
    Nick over 7 years
    @SimonEast not possible.
  • Liam McArthur
    Liam McArthur over 7 years
    We decided to set up a brand new subdomain under our main brand domain and needed to set up static.website.brand-name.co.uk so that we could serve content from a cookieless domain - but that's out the window now since SSL isn't going to work with it.
  • Nehal J Wani
    Nehal J Wani over 7 years
    This should be the accepted answer. @Nick, go to sslshopper.com/ssl-checker.html#hostname=google.com and take a look at the SAN section
  • Nick
    Nick over 7 years
    @NehalJWani what should I look for?
  • Nehal J Wani
    Nehal J Wani over 7 years
    @Nick In your previous comment, you said 'Not possible'. I am showing to you that it is not only possible, but that is how google is handling it's sub-sub domains. Look at the SANs section picpaste.com/pics/…
  • Nick
    Nick over 7 years
    I dont see sub sub domains? ..domain.com is not possible. *.abc.domain.com - no problem . pls correct me
  • Nick
    Nick over 7 years
    ..domain.com is not possible to be issued
  • CoryG
    CoryG over 7 years
    @iconoclast There are none, *.domain.gTLD is smaller and faster to match all subdomains than *.domain.gTLD+*.sub1.domain.gTLD+*.sub2.domain.gTLD, etc. It's like the way the cable companies tell you they aren't legally allowed to sell cheap residential service to businesses or the way banks say they legally have to charge a fee if you overdraft the account: while it's true they lobbied to make it that way. That isn't to say SSL certs are entirely a scam, CAs have a purpose and there is some overhead, but anything more than $30/year for a whole-domain wildcard SSL cert is a scam.
  • hraban
    hraban over 6 years
    @Carl that attack on p91 depends on finding punycode chars which resemble ? and /, at which point finding one which looks like a dot is no stretch. Punycode homograms are a bigger problem than just ..x support, I don't think this is a valid solution.
  • bchurchill
    bchurchill over 5 years
    @Carl to add to hraban, in the first case it's not the possession of a wildcard certificate that makes you vulnerable, but rather that someone else can get a wildcard certificate that has homograms. In the second case, yes, risks are increased, but this attack is only possible because the server doesn't check its own hostname (which it should!).
  • Bruno Bronosky
    Bruno Bronosky about 5 years
    @ShaneRowatt said "can you have ..example.com to secure first and second level sub-domains?" I can tell you that AWS Certificate Manager does not allow you to request those kind of certificates.
  • Shane Rowatt
    Shane Rowatt about 5 years
    @BrunoBronosky Whilst double wildcard certs like *.*.example.com are not allowed I've found that you can get a multi-domain wildcard certificate, where you can add multiple domains or subdomains up to 4kb in text which gives you anywhere up to 250 domain names depending on domain name length.