Certificate Details as readable format


#1

Hello everyone,

I have a dashboard page in my application. I would want to show the details of certificate generated, the valid to date and the domain details.

I have tried to get the details from crt.sh but it returns a webpage.

Is there any chances to get the generated certificates details to show as the above format.

Thanks in advance.


#2

This is quite unrelated to Lets Encrypt.
Use the openssl (x509) tools or any API that fits your needs and programming language.

Example:

$ openssl x509 -dates -subject -noout < crt.pem
notBefore=Mar 12 11:48:27 2018 GMT
notAfter=Jun 10 11:48:27 2018 GMT
subject= /CN=example.com


#3

Thank you @bytecamp .

Do you have any suggestion on API? Currently, I am working with Perl Programming Language,

Thanks


#4

Hi,

You can also use curl to gather Certificate info.

curl --insecure -v https://www.google.com 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }'

echo | openssl s_client -showcerts -servername google.com -connect google.co.uk:443 | openssl x509 -inform pem -noout -text

You can also grep the certificate expire date from crt.sh

I don’t really know what API is necessary since your local program can always help you with this issue.

Thank you


#5

Hi @srajkumar1986,

For a Perl application, you might want to look at

This should be able to parse a PEM-format certificate and give you access to these details about the certificate contents from inside of Perl.


#6

Have a look at Net::SSLeay.


#7

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.