From b848b2a6072b1d486cf20c3fbd1cd838340d12da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 28 Oct 2013 13:16:01 +0100 Subject: [PATCH 1/2] openssl: command to show certificate infos Did you ever was on a server, but did not remember, what the certificate is for? --- cheatsheets/openssl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cheatsheets/openssl b/cheatsheets/openssl index b020c85..3a7e9c3 100644 --- a/cheatsheets/openssl +++ b/cheatsheets/openssl @@ -7,6 +7,12 @@ openssl req -new -key server.key -out server.csr # To sign a certificate using a private key and CSR: openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt +# To show certificate information for a certificate signing request +openssl req -text -noout -in server.csr + +# To show certificate information for generated certificate +openssl x509 -text -noout -in server.crt + # (The above commands may be run in sequence to generate a self-signed SSL certificate.) # To view certificate expiration: From 9f50f3b310190025854fc51bbc0043e5fb698427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 28 Oct 2013 18:22:55 +0100 Subject: [PATCH 2/2] openssl: move note about self-signed certificates up commit b848b2a6072b1d48 inserted additional commands to show certificate, which are related to the comment. --- cheatsheets/openssl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cheatsheets/openssl b/cheatsheets/openssl index 3a7e9c3..74a2511 100644 --- a/cheatsheets/openssl +++ b/cheatsheets/openssl @@ -7,14 +7,14 @@ openssl req -new -key server.key -out server.csr # To sign a certificate using a private key and CSR: openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt +# (The above commands may be run in sequence to generate a self-signed SSL certificate.) + # To show certificate information for a certificate signing request openssl req -text -noout -in server.csr # To show certificate information for generated certificate openssl x509 -text -noout -in server.crt -# (The above commands may be run in sequence to generate a self-signed SSL certificate.) - # To view certificate expiration: echo | openssl s_client -connect :443 2> /dev/null | \ awk '/-----BEGIN/,/END CERTIFICATE-----/' | \