Skip to content

Instantly share code, notes, and snippets.

@merlinxcy
Created November 18, 2019 08:39
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 merlinxcy/0a22ee92f8416aa61a0a9e7338162f6b to your computer and use it in GitHub Desktop.
Save merlinxcy/0a22ee92f8416aa61a0a9e7338162f6b to your computer and use it in GitHub Desktop.
generate_ssl_cert.sh
./gencert.sh
Enter your domain [www.example.com]: www.test.com
Create server key...
Generating RSA private key, 1024 bit long modulus
.................++++++
.....++++++
e is 65537 (0x10001)
Enter pass phrase for www.test.com.key:输入口令
Verifying - Enter pass phrase for www.test.com.key:输入口令
Create server certificate signing request...
Enter pass phrase for www.test.com.key:输入口令
Remove password...
Enter pass phrase for www.test.com.origin.key:输入口令
writing RSA key
Sign SSL certificate...
Signature ok
subject=/C=US/ST=Mars/L=iTranswarp/O=iTranswarp/OU=iTranswarp/CN=www.test.com
Getting Private key
TODO:
Copy www.test.com.crt to /etc/nginx/ssl/www.test.com.crt
Copy www.test.com.key to /etc/nginx/ssl/www.test.com.key
Add configuration in nginx:
server {
...
ssl on;
ssl_certificate /etc/nginx/ssl/www.test.com.crt;
ssl_certificate_key /etc/nginx/ssl/www.test.com.key;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment