Skip to content

Instantly share code, notes, and snippets.

@techforum-repo
Last active May 7, 2024 11:39
Show Gist options
  • Save techforum-repo/ff455cf310982e815423c745494e7bc0 to your computer and use it in GitHub Desktop.
Save techforum-repo/ff455cf310982e815423c745494e7bc0 to your computer and use it in GitHub Desktop.

Create an RSA-2048 key and save it to a file rootCA.key

openssl genrsa -des3 -out rootCA.key 2048

Create a root certificate through the key generated

openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1460 -out rootCA.pem

Create a private key and CSR for local Certificare

openssl req -new -sha256 -nodes -out server.csr -newkey rsa:2048 -keyout server.key -config server.csr.cnf

Issue a certificate via the root SSL certificate and the CSR

openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 -sha256 -extfile v3.ext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment