OpenSSL: Difference between revisions

From Anthony Pastor Wiki Notes - Verba volant, scripta manent
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 3: Line 3:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
openssl req -nodes -new -x509 -keyout server.key -out server.cert -days 3650
openssl req -nodes -new -x509 -keyout server.key -out server.cert -days 3650
</syntaxhighlight>
== Getting the expiration time of an SMTP certificate ==
<syntaxhighlight lang="bash">
SERVERNAME=mail.example.com
printf 'quit\n' | openssl s_client -connect $SERVERNAME:587 -starttls smtp | openssl x509 -enddate -noout
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 15:15, 3 January 2018

Generate a self-signed certificate without passphrase in one line

openssl req -nodes -new -x509 -keyout server.key -out server.cert -days 3650

Getting the expiration time of an SMTP certificate

SERVERNAME=mail.example.com
printf 'quit\n' | openssl s_client -connect $SERVERNAME:587 -starttls smtp | openssl x509 -enddate -noout