2015-12-30 15:31:55 +00:00
|
|
|
# openssl
|
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
> OpenSSL cryptographic toolkit.
|
2015-12-30 15:31:55 +00:00
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
- Generate a 2048bit RSA private key and save it to a file:
|
2015-12-30 15:31:55 +00:00
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
`openssl genrsa -out {{filename.key}} 2048`
|
2015-12-30 15:31:55 +00:00
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
- Generate a certificate signing request to be sent to a certificate authority:
|
2015-12-30 15:31:55 +00:00
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
`openssl req -new -sha256 -key {{filename.key}} -out {{filename.csr}}`
|
2015-12-30 15:31:55 +00:00
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
- Read contents of a signed certificate:
|
2015-12-30 15:31:55 +00:00
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
`openssl x509 -text -noout -in {{certificate.crt}}`
|
2016-01-05 14:26:54 +00:00
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
- Display the certificate presented by an SSL/TLS server:
|
2016-01-05 14:26:54 +00:00
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
`openssl s_client -connect {{host}}:{{port}} </dev/null`
|
2016-01-05 14:26:54 +00:00
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
- Display the complete certificate chain of an HTTPS server:
|
2016-01-05 14:26:54 +00:00
|
|
|
|
2016-01-20 18:11:47 +00:00
|
|
|
`openssl s_client -connect {{google.com}}:{{443}} -showcerts </dev/null`
|