This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| snippets:openssl [2017/11/01 09:30] – allspark | snippets:openssl [2025/03/06 10:20] (current) – allspark | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # create selfsign | ||
| + | ``` | ||
| + | openssl genrsa -out server.key 4096 | ||
| + | openssl req -new -key server.key -out server.csr | ||
| + | openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt | ||
| + | ``` | ||
| + | |||
| + | # exporting | ||
| + | |||
| + | ``` | ||
| + | Run the following command to export the private key: openssl pkcs12 -in certname.pfx -nocerts -out key.pem -nodes | ||
| + | Run the following command to export the certificate: | ||
| + | Run the following command to remove the passphrase from the private key: openssl rsa -in key.pem -out server.key | ||
| + | ``` | ||
| + | |||
| + | # to pkcs12 | ||
| + | |||
| + | ``` | ||
| + | openssl pkcs12 -export -out c.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem -passout pass:< | ||
| + | ``` | ||
| + | |||
| + | # dhparams | ||
| + | |||
| + | ``` | ||
| + | openssl dhparam -out / | ||
| + | ``` | ||
| + | |||
| + | # connect to TLS port | ||
| + | |||
| + | ``` | ||
| + | openssl s_client --connect < | ||
| + | ``` | ||