Last active
September 5, 2025 21:54
-
-
Save anzz1/fdc3176b6f8ac194b73097f55853631d to your computer and use it in GitHub Desktop.
create_cert.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # create CA certificate | |
| openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -sha256 -days 10950 -nodes -subj "/CN=www.example.com" | |
| # create non-CA certificate (OpenSSL >=v1.1.1) | |
| #openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -sha256 -days 10950 -nodes -subj "/CN=www.example.com" -addext "authorityKeyIdentifier=keyid" -addext "basicConstraints=CA:FALSE" | |
| # create non-CA TLS certificate (OpenSSL >=v1.1.1) | |
| #openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -sha256 -days 10950 -nodes -subj "/CN=www.example.com" -addext "authorityKeyIdentifier=keyid" -addext "basicConstraints=CA:FALSE" -addext "extendedKeyUsage=serverAuth" -addext "subjectAltName=DNS:www.example.com" | |
| # create 1024-bit dhparams | |
| #openssl dhparam -out dh1024.pem 1024 | |
| # print result | |
| openssl x509 -noout -text -in cert.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment