Skip to content

Instantly share code, notes, and snippets.

@Megakuul
Last active October 8, 2024 11:04
Show Gist options
  • Select an option

  • Save Megakuul/49bbdbdf39a94aed9f4a0159e52dce1c to your computer and use it in GitHub Desktop.

Select an option

Save Megakuul/49bbdbdf39a94aed9f4a0159e52dce1c to your computer and use it in GitHub Desktop.
create self signed

Create self signed ssl certificate

Generate a certificate signing request (this generates the privkey.pem and includes the public key in the csr):

openssl req -new -nodes > req.csr

Then convert the public key to a public certificate and sign it with its own private key.

openssl x509 -req -in req.csr -signkey privkey.pem -out cert.pem

If you want, you can also encrypt the private key:

openssl rsa -in privkey.pem -aes256 -out key.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment