Welcome! Log In Create A New Profile

Advanced

Re: Wildcard SSL and Wildcard hostnames

Reinis Rozitis
May 11, 2015 10:58AM
> http://example.co - works fine and as expected.
> http://blah.example.co - returns curl: (60) SSL certificate problem:
> Invalid certificate chain

> This is actually picking up the SSL cert for the default site on the
> server.
> So the server_name is picking up example.co but *.example.co seems to be
> ignored.

So are there 2 certificates?
If so you need a different server block for each - one for the exact domain
and one for the wildcard (or use the wildcard for both).

Besides server_name .example.co and server_name example.co, *.example.co are
generally the same (the latter actually being recommended
http://nginx.org/en/docs/http/server_names.html#optimization )

The only difference would be if you have multiple server {} definitions
(with same domains) because nginx has an order of precedence in which it
decides which virtual server will be chosen (regular expressions (which is
also .example.co) will be last).

In general you should check (for example with 'openssl x509 -in
/path/example.co.crt -noout -text | grep DNS') and see if your nginx
server{} block configuration actually matches the certificates (and keys)
you point to.

It makes a bit hard to guess not seing the whole config.



One note when testing with curl - on older systems the root certificates are
not always updated and if the CA has _recently_ changed its intermediate
certificates (iirc for example GoDaddy) curl might report a problem.

Also be sure that the intermediate certificates are included in the
certificate itself (
http://nginx.org/en/docs/http/configuring_https_servers.html#chains )



> we also need *.staging.example.co to work for our staging environment too
> which
might kill two birds with one stone.

Standard wildcard certificate *.example.co covers also this, you don't need
additional certificates.



p.s. A good/simple way imo (if the server has public access) to check for
all kinds of issues/ssl chains etc is to use
https://www.ssllabs.com/ssltest/ (check the "do not show" if you want hidden
results).

rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Wildcard SSL and Wildcard hostnames

braindeaf May 11, 2015 07:11AM

Re: Wildcard SSL and Wildcard hostnames

B.R. May 11, 2015 07:34AM

Re: Wildcard SSL and Wildcard hostnames

Reinis Rozitis May 11, 2015 07:38AM

Re: Wildcard SSL and Wildcard hostnames

braindeaf May 11, 2015 09:54AM

Re: Wildcard SSL and Wildcard hostnames

itpp2012 May 11, 2015 10:15AM

Re: Wildcard SSL and Wildcard hostnames

braindeaf May 11, 2015 10:26AM

Re: Wildcard SSL and Wildcard hostnames

B.R. May 11, 2015 10:00AM

Re: Wildcard SSL and Wildcard hostnames

Reinis Rozitis May 11, 2015 10:58AM

Re: Wildcard SSL and Wildcard hostnames

braindeaf May 11, 2015 11:23AM

Re: Wildcard SSL and Wildcard hostnames

Reinis Rozitis May 11, 2015 12:00PM

Re: Wildcard SSL and Wildcard hostnames

ron ramos May 12, 2015 05:14AM

Re: Wildcard SSL and Wildcard hostnames

itpp2012 May 11, 2015 09:51AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 159
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready