I need to download a SSL cert in PEM format from a HTTPS website, https://api.paczkomaty.pl . So I am using OpenSSL to do that:
openssl s_client -connect api.paczkomaty.pl:443 > myfile openssl x509 -in myfile -text
Here's the result:
Certificate: Data: Version: 3 (0x2) Serial Number: 0d:5a:87:30:7e:43:96:05:5e:20:f3:2f:14:a4:d9:47 Signature Algorithm: sha256WithRSAEncryption Issuer: C = US, O = GeoTrust Inc., CN = RapidSSL SHA256 CA Validity Not Before: Mar 11 00:00:00 2017 GMT Not After : Apr 10 23:59:59 2018 GMT Subject: CN = *.grupainteger.pl (...)
However, when I visit the website via a browser (Chrome or Firefox) and inspect its certificate, it shows me a different one; its Serial Number is different, and its validity is from 15/1/2018 to 1/9/2018.
Why is OpenSSL fetching a different certificate?