nginx Configuration supports HTTPS access
To generate a certificate:
1. Create the server private key, the command will let you enter a password:
OpenSSL genrsa-des3-out Server.key 1024
Password to take a random
2. Create a signing Request certificate (CSR):
OpenSSL Req-new-key server.key-out SERVER.CSR
3. Remove the required password when loading SSL-supported Nginx and using the private key above:
CP Server.key server.key.org
OpenSSL rsa-in server.key.org-out Server.key
4. Mark certificates use the above private key and CSR:
OpenSSL x509-req-days 365-in server.csr-signkey server.key-out server.crt
to modify the Nginx configuration:
1. Copy server.crt and Server.key to the specified directory
2. Modify the configuration file to load SERVER.CRT and Server.key
3. Restart Nginx
At this point, the Nginx HTTPS has been configured to complete.
Reference:
Http://www.cnblogs.com/yanghuahui/archive/2012/06/25/2561568.html
Http://www.abcde.cn/info/show-26-1511-1.html
Tomcat Configuration supports HTTPS access
1. Create a KeyStore file to store the server's private key and self-signed certificate.
HTTPS communication simply said, the server's certificate contains the server's public key, and then the browser and the server communication, the browser can use the server's public key to encrypt the message, the server can use its own private key to decrypt the message, so that the completion of the secure communication, In fact, the communication process of HTTPS is far more complicated than this.
Keytool-genkey-alias Tomcat-keyalg RSA
A. keystore file is generated under the C:\Users\user directory, which holds the private key and certificate information to view keystore information: Keytool-list-v-keystore.keystore
The. KeyStore file contains both the certificate and the private key.
2. Let tomcat load the self-signed certificate. Store the. keystore file under Tomcat's Conf directory and modify the Server.xml:
<connectorport= "8443" sslenabled= "true"
maxthreads= "Scheme=" "https" secure= "true"
Clientauth= "false" sslprotocol= "TLS"
Protocol= "Org.apache.coyote.http11.Http11Protocol"
keystorepass= "123456" keystorefile= "Conf/.keystore"/>
3. Restart Tomcat.