thanks @ahaw021 and @schoen.
With the output of openssl I could get that I was interested in the X3 certificate:
openssl s_client -connect helloworld.letsencrypt.org:443 -showcerts
# ...
# issuer=/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
# ...
# Verify return code: 20 (unable to get local issuer certificate)
Then I downloaded the self signed one:
wget "https://letsencrypt.org/certs/letsencryptauthorityx3.pem.txt" --output-document=letsencryptauthorityx3.pem
And then I could verify the helloworld certificate:
openssl s_client -connect helloworld.letsencrypt.org:443 -showcerts -CAfile letsencryptauthorityx3.pem
# Verify return code: 0 (ok)
I also tried with the X-signed certificate:
openssl s_client -connect helloworld.letsencrypt.org:443 -showcerts -CAfile lets-encrypt-x3-cross-signed.pem
# Verify return code: 0 (ok)
Then I tried all the commands with my application’s host (that I am calling here my.example.com
) instead of helloworld.letsencrypt.org
, and, as I expected, they always returned the same return codes for the same test caes, because they’re signed with the same certificates.
However there is still something quite weird: With wget
, I can’t download from my host:
wget https://my.example.com/ --output-document=-
ERROR: The certificate of ‘my.example.com.com’ is not trusted.
ERROR: The certificate of ‘my.example.com’ hasn't got a known issuer.
That is “solved” if I add the certificate file:
wget https://my.example.com/ --output-document=- --ca-certificate=letsencryptauthorityx3.pem
# Welcome to my application
But, to download from helloworld.letsencrypt.org
, I don’t need a certificate:
wget https://helloworld.letsencrypt.org --output-document=-
# ...
# /body>
# </html>
The same behaviour is observed if I use curl
instead of wget
.
now the question is: why do I need to add --ca-certificate for wget to work with my certificate but not to work with helloworld.letsencrypt.org? Aren’t they signed in the same chain of trust?