Last active
March 21, 2019 04:25
-
-
Save acoshift/a5ecdb6beef2b8a626750b8245cd84e0 to your computer and use it in GitHub Desktop.
Generate self-signed certification for server-client
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
#!/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 |
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
#!/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