Last active
March 11, 2024 10:24
-
-
Save maniankara/b24c50dcbb1e9f88d1bb7a78fe452b24 to your computer and use it in GitHub Desktop.
Create a self signed certificate
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
# Without CA | |
openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes -keyout selfsigned.key -out selfsigned.crt -subj "/C=FI/ST=Uusimaa/L=Helsinki/O=Verifa Oy/OU=IT/CN=example.verifa.io/[email protected]" -addext 'subjectAltName=DNS:sample.verifa.io,DNS=sample.verifa.com' | |
# With CA (repeats some steps from above) | |
openssl req -newkey rsa:2048 -nodes -keyout selfsigned.key -out selfsigned.csr -subj "/C=FI/ST=Uusimaa/L=Helsinki/O=Verifa Oy/OU=IT/CN=server.test.com/[email protected]" | |
openssl req -x509 -sha256 -days 1825 -newkey rsa:2048 -keyout rootCA.key -out rootCA.crt -subj "/C=FI/ST=Uusimaa/L=Helsinki/O=Verifa Oy/OU=IT/CN=server.test.com/[email protected]" -passout pass:test123 | |
openssl x509 -req -CA rootCA.crt -CAkey rootCA.key -in selfsigned.csr -out selfsigned.crt -days 365 -CAcreateserial -passin pass:test123 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment