Score:0

Letsencrypt certificate works only internally to the instance, but when queried externally cert is not valid anymore

eh flag

I have one instance on Heroku with a auto generated certificate for mysite.com I have created a EC2 instance on AWS and generated a letsencrypt certificate for api.mysite.com

From the EC2 instance, if I execute

curl https://api.mysite.com/

I get the proper response-

From a browser or postman, I get

SSL Error: Certificate is not yet valid

My nginx config:

server {
    listen 443 ssl; 
    server_name api.mysite.com;
    include snippets/letsencrypt.conf;

    ssl_certificate /etc/letsencrypt/live/api.mysite.com/fullchain.pem; 
    ssl_certificate_key /etc/letsencrypt/live/api.mysite.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/api.mysite.com/chain.pem;

    ssl_dhparam /etc/ssl/certs/dhparam.pem;

    location / {
        include uwsgi_params;
        uwsgi_pass unix:/opt/app.sock;
    }
}

Any idea what the issue could be?

Ginnungagap avatar
gu flag
I'm assuming the computer you're testing from has a woefully out of sync clock
Vincent Teyssier avatar
eh flag
lol, you are assuming right!
vidarlo avatar
ar flag
@Ginnungagap Please don't post answers as comments.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.