Skip to content

Instantly share code, notes, and snippets.

@acoshift
Last active March 21, 2019 04:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acoshift/a5ecdb6beef2b8a626750b8245cd84e0 to your computer and use it in GitHub Desktop.
Save acoshift/a5ecdb6beef2b8a626750b8245cd84e0 to your computer and use it in GitHub Desktop.
Generate self-signed certification for server-client
#!/bin/bash
openssl genrsa -out $1.key 2048
openssl rsa -in $1.key -out $1.key
chmod 400 $1.key
openssl req -new -key $1.key -out $1.csr -subj "/CN=$1"
openssl x509 -req -in $1.csr -days 365 -CA server.crt -CAkey server.key -out $1.crt -CAcreateserial
rm $1.csr
#!/bin/bash
openssl genrsa -out server.key 2048
openssl rsa -in server.key -out server.key
chmod 400 server.key
openssl req -new -key server.key -days 3650 -out server.crt -x509
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment