With this Nginx config:
server {
listen 443 ssl;
server_name www.x.nl x.nl;
ssl_certificate /etc/nginx/ssl/x.nl.crtkeyca;
ssl_certificate_key /etc/nginx/ssl/x.nl.crtkeyca;
[...]
}
This works:
openssl s_client -servername www.x.nl -connect localhost:443 < /dev/null
This doesn't, as I get the default vhost CN:
openssl s_client -servername x.nl -connect localhost:443 < /dev/null
Am using stock Nginx from Ubuntu 12.04 LTS, unfortunately very old (1.1.19).
Is it supposed to work in newer versions or do I require to duplicate my server {}
definitions?
I had same issue with Nginx 1.8.0.
In my case, this issue fixes setup different name in ssl_session_cache (see "???"):