0

I have an old sub domain : api.example.com and a ssl certification with it ( Now i am using letsencrypt and nginx ). Then i created a new sub domain for it internship.example.com and generated a new ssl certification for it. But when i check on website , it shows this error:

Certificate does not match name internship.example.com.On website, SSL Common name is : Common Name = api.example.com But when i show common name on server by command :

sudo openssl x509 -noout -in /etc/letsencrypt/live/internship.example.com/fullchain.pem -subject -issuer -dates

it is correct :

subject= /CN=internship.example.com
issuer= /C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
notBefore=Apr 13 01:02:00 2017 GMT
notAfter=Jul 12 01:02:00 2017 GMT

This is nginx config file :

server {
   listen 443 ssl;
   server_name internship.example.com;
   #root /usr/share/nginx/html;
   #index index.html index.htm;

   ssl on;
   ssl_certificate /etc/letsencrypt/live/internship.example.com/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/internship.example.com/privkey.pem;

   location / {
          proxy_pass http://localhost:4000;
                      proxy_http_version 1.1;
                      proxy_set_header Upgrade $http_upgrade;
                      proxy_set_header Connection 'upgrade';
                      proxy_set_header Host $host;
                      proxy_cache_bypass $http_upgrade;
   }
}

So why it is incorrect on website ? can someone explain it for me?

2
  • well, Pls help me !!!
    – voxter
    Apr 13, 2017 at 7:55
  • Use nginx -T to test and list your actual configuration. Apr 13, 2017 at 8:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.