linux:verschluesselung:openssl
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:verschluesselung:openssl [2024/06/19 18:18] – [Zertifikate konvertieren] gsys | linux:verschluesselung:openssl [2025/05/06 11:48] (current) – gsys | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== OpenSSL ====== | ====== OpenSSL ====== | ||
| + | |||
| ===== Nützliche Befehle ===== | ===== Nützliche Befehle ===== | ||
| < | < | ||
| update-ca-certificates --fresh | update-ca-certificates --fresh | ||
| + | |||
| + | openssl x509 -in mail.example.com.pem -noout -text # Check contents of cert file | ||
| + | |||
| openssl s_client -connect mail.example.com: | openssl s_client -connect mail.example.com: | ||
| openssl s_client -connect mail.example.com: | openssl s_client -connect mail.example.com: | ||
| Line 68: | Line 72: | ||
| ===== Zertifikate konvertieren ===== | ===== Zertifikate konvertieren ===== | ||
| + | |||
| + | ==== Reihenfolge einer Chain ==== | ||
| + | Optimal: | ||
| + | < | ||
| + | -----BEGIN CERTIFICATE----- | ||
| + | [Server Certificate] | ||
| + | -----END CERTIFICATE----- | ||
| + | -----BEGIN CERTIFICATE----- | ||
| + | [Intermediate certificate L1] | ||
| + | -----END CERTIFICATE----- | ||
| + | -----BEGIN CERTIFICATE----- | ||
| + | [Intermediate certificate L2] | ||
| + | -----END CERTIFICATE----- | ||
| + | </ | ||
| + | Unnötig da Root in Browser/OS Cert store bereits enthalten: | ||
| + | < | ||
| + | -----BEGIN CERTIFICATE----- | ||
| + | [Server Certificate] | ||
| + | -----END CERTIFICATE----- | ||
| + | -----BEGIN CERTIFICATE----- | ||
| + | [Intermediate certificate L1] | ||
| + | -----END CERTIFICATE----- | ||
| + | -----BEGIN CERTIFICATE----- | ||
| + | [Intermediate certificate L2] | ||
| + | -----END CERTIFICATE----- | ||
| + | -----BEGIN CERTIFICATE----- | ||
| + | [Root Certificate] | ||
| + | -----END CERTIFICATE----- | ||
| + | </ | ||
| + | https:// | ||
| + | https:// | ||
| + | |||
| + | ==== Befehle ==== | ||
| + | |||
| + | '' | ||
| + | |||
| FIXME PEM vs CRT | FIXME PEM vs CRT | ||
| < | < | ||
| Line 73: | Line 113: | ||
| cat cert.pem intermediate.pem > chain.pem | cat cert.pem intermediate.pem > chain.pem | ||
| cat root.pem intermediate.pem > ocsp-chain.pem | cat root.pem intermediate.pem > ocsp-chain.pem | ||
| - | openssl pkcs12 -in cert_bundle.p12 -nokeys -out cert_bundle.pem | + | openssl pkcs12 -in cert_bundle.p12 |
| + | openssl pkcs12 -in cert_bundle.p12 -cacerts -nokeys -out cert_cacerts.pem | ||
| openssl pkcs12 -in cert_bundle.p12 -clcerts -nokeys -out cert.pem | openssl pkcs12 -in cert_bundle.p12 -clcerts -nokeys -out cert.pem | ||
| openssl pkcs12 -in cert_bundle.p12 -nocerts -out privkey_encr.key | openssl pkcs12 -in cert_bundle.p12 -nocerts -out privkey_encr.key | ||
| Line 79: | Line 120: | ||
| openssl x509 -inform der -in certificate.cer -out certificate.pem | openssl x509 -inform der -in certificate.cer -out certificate.pem | ||
| openssl pkcs7 -inform der -in cacert.p7b -out cacert.pem | openssl pkcs7 -inform der -in cacert.p7b -out cacert.pem | ||
| + | </ | ||
| + | |||
| + | Permissions | ||
| + | < | ||
| + | chmod 700 private | ||
| + | chmod 600 private.key | ||
| + | chmod 755 certs #public certs folder | ||
| + | chmod 644 cert.pem | ||
| </ | </ | ||
linux/verschluesselung/openssl.1718813927.txt.gz · Last modified: by gsys