Skip to content

Instantly share code, notes, and snippets.

@arefaslani
Created December 29, 2018 09:06
Show Gist options
  • Save arefaslani/84eb6283bd4b1cb8a0ceeeb32763e466 to your computer and use it in GitHub Desktop.
Save arefaslani/84eb6283bd4b1cb8a0ceeeb32763e466 to your computer and use it in GitHub Desktop.
Create Self Signed Certificate

Let's generate the server pass key

$ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048

now generate the server key from the pass key

$ openssl rsa -passin pass:x -in server.pass.key -out server.key

we remove the pass key

$ rm server.pass.key

now let's create the .csr file

$ openssl req -new -key server.key -out server.csr ... Country Name (2 letter code) [AU]:MX State or Province Name (full name) [Some-State]:Michoacan ... A challenge password []: ...

now let's create the .crt file

$ openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt

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