Https_ssl Apache authentication, configuration, steps, and rationale

Source: Internet
Author: User

One, 1. One-way authentication is that the transmitted data is encrypted, but the source of the client is not verified

2. Two-way authentication, if the client browser does not import the client certificate, is not able to access the web system, can not find the address, want to use the system without a certificate can not access the system HTTPS concept

Second, 1. One-way authentication is the transmission of data encryption, but will not research customer source

2. Two-way authentication, if the client browser does not import the client certificate, is not able to access the web system, can not find the address, want to use the system of people without a certificate is not able to access HTTPS

2.1https concept, is a security-targeted HTTP channel, is the security version of HTTP, HTTP is SSL security authentication, the basis of HTTPS is SSL so encryption details require SSL

Iii. the difference between HTTPS and HTTP

1.HTTPS protocol requires a certificate to the CA, once a free certificate is very small and requires payment

2.http hypertext Protocol, the transmission of information is usually clear text, and HTTPS is SSL encrypted before transmission

3.http and HTTPS use a completely different way of connection, using the default port is not the same, HTTP default port: 80, and HTTPS default port is 432

The 4.http connection is simple and stateless, and the HTTPS protocol is a network protocol built by the SSL+HTTP protocol to encrypt and transmit authentication, which is more secure than the HTTP protocol.

Iv. the role of HTTPS

1. The main role is divided into two kinds

1.1 Establish information security channel to ensure the security of data transmission

1.2 Confirm the security of the website

2. The general meaning of HTTPS is that the service has a certificate, the main purpose is to ensure that the service is the server he claims, meaning that the service side and client communications are SSL encryption.

3. The client certificate is actually the communication, not only to verify your user name password, but also to verify your CA certificate

Five, the Https_ssl configuration steps:

    1. Verify that you have created a certificate with the same name

Keytool-list-v-alias tomcat-keystore "%java_home%/jre/lib/security/cacerts"-storepass Changeit

2. Delete the certificate you have created

Keytool-delete-alias tomcat-keystore "%java_home%/jre/lib/security/cacerts"-storepass Changeit

3. Create a certificate

3.1 Generate a certificate in the server:

(Note: When generating a certificate, the CN will be the same as the domain name of the server, if tested locally, use localhost)

Keytool-genkey-alias tomcat-keyalg rsa-keystore d:/mykeystore-dname "Cn=localhost, OU=localhost, O=localhost, L=SH, S T=sh, C=CN "-keypass changeit-storepass Changeit

Keytool is the certificate generation tool provided by the JDK, and the use of all parameters is described in Keytool–help

-genkey Creating a new certificate

-V Detailed information

-alias "MyKey" as the alias for the certificate. This can be modified as needed

-keyalgrsa Specifying the algorithm

-keysize specifying algorithm encryption key length

-keystorec:\sdust.keystore save path and file name

-VALIDITY3650 Certificate validity period, unit of day

cn= the configuration of your IP,OU=CN,O=CN,L=CN,ST=CN,C=CN basic information

Cn= Your IP This configuration is important to note

-storepass 123456789-keypass 123456789 Password settings

3.2 Export certificate, installed by client:

Keytool-export-alias Tomcat-keystore d:/mykeystore-file D:/mycerts.cer-storepass Changeit

3.3 Client Configuration: Import the key for the client's JVM (import the certificate issued by the server into the JVM)

Keytool-import-trustcacerts-alias tomcat-keystore "%java_home%/jre/lib/security/cacerts"-file d:/mycerts.cer- Storepass Changeit

4. Configure Tomcat SSL

Modify the SSL service in Server.xml

<connector port= "8443" maxhttpheadersize= "8192"
maxthreads= "minsparethreads=" maxsparethreads= "75"
Enablelookups= "false" disableuploadtimeout= "true"
Acceptcount= "Scheme=" "https" secure= "true"
Clientauth= "false" sslprotocol= "TLS" keystorefile= "Server.keystore" keystorepass= "Changeit"/>

Property Description: ClientAuth: Set whether bidirectional authentication, default is False, set to true to represent two-way authentication keystorefile: Server certificate file path keystorepass: Server certificate Password Truststorefile: The root certificate used to authenticate the client certificate, in this case the server certificate truststorepass: Root certificate Password

5. Frequently Asked Questions

    1. Could not find a trusted certificate

The main reason is that the client does not import the server certificate into the JVM, you can use the

Keytool-list-alias tomcat-keystore "%java_home%/jre/lib/security/cacerts"-storepass Changeit

To see if the certificate is actually imported into the JVM.

    1. Keytool Error: Java.io.IOException:keystore was tampered with,or password was incorrect

The reason is whether there is a. KeyStore exists in your home directory. If it exists then remove it and then execute it

Or remove the%java_home%/jre/lib/security/cacerts and then execute

It is recommended to delete Cacerts and import it directly.

Https_ssl Apache authentication, configuration, steps, and rationale

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.