tldr/pages/common/openssl.md

24 lines
763 B
Markdown
Raw Normal View History

2015-12-30 15:31:55 +00:00
# openssl
> OpenSSL is a cryptography toolkit.
- Check an SSL connection
2015-12-30 18:32:23 +00:00
`openssl s_client -connect {{url}}:443`
2015-12-30 15:31:55 +00:00
- Generate new private key and CSR
2015-12-30 18:32:23 +00:00
`openssl req -out {{path/to/CSR.csr}} -new -newkey rsa:2048 -nodes -keyout {{path/to/pivate.key}}`
2015-12-30 15:31:55 +00:00
- Read contents of certificate, private key and CSR file
2015-12-30 18:32:23 +00:00
`openssl x509 -text -noout -in {{path/to/certificate.crt}}`
`openssl rsa -check -in {{path/to/pivate.key}}`
`openssl req -text -noout -verify -in {{path/to/CSR.csr}}`
2015-12-30 15:31:55 +00:00
- Check if certificate, private key and CSR have the same MD5 hash
2015-12-30 18:32:23 +00:00
`openssl x509 -noout -modulus -in {{path/to/certificate.crt}} | openssl md5`
`openssl rsa -noout -modulus -in {{path/to/pivate.key}} | openssl md5`
`openssl req -noout -modulus -in {{path/to/CSR.csr}} | openssl md5`