OpenSSL: Difference between revisions

From Anthony Pastor Wiki Notes - Verba volant, scripta manent
Jump to navigation Jump to search
(Created page with "== Global == * Generate a self-signer certificate without passphrase in one line: <syntaxhighlight lang="bash"> openssl req -nodes -new -x509 -keyout server.key -out server.c...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Global ==
== Generate a self-signed certificate without passphrase in one line ==
* Generate a self-signer certificate without passphrase in one line:


<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