HTTPS production process.

Source: Internet
Author: User
HTTPS production process. -- Linux Enterprise Application-Linux server application information. For details, refer to the following section. [I = s] This post was last edited by linux. leo at, September 21 ,.

SSL encryption
SSL (Secure Socket Layer)
Developed for Netscape to ensure the security of data transmission over the Internet, using data Encryption technology,
It ensures that data is not intercepted or eavesdropped during network transmission.
At present, the general specification is 40 bits, and the US has released 128 bits for higher security.

The SSL protocol is located between the TCP/IP protocol and various application layer protocols to provide security support for data communication.
The SSL Protocol can be divided into two layers: SSL Record Protocol (SSL Record Protocol): it is built on a reliable transmission Protocol (such as TCP, provides data encapsulation, compression, encryption, and other basic functions for high-level protocols.
SSL Handshake Protocol: It is built on the SSL record Protocol and used before the actual data transmission starts, both parties perform identity authentication, negotiate encryption algorithms, and exchange encryption keys.

SSL provides the following services:
1) authenticate users and servers to ensure that data is sent to the correct client and server;
2) encrypt data to prevent data theft;
3) maintain data integrity and ensure that data is not changed during transmission.

SSL protocol workflow:
Server Authentication phase: 1) the client sends a start message "Hello" to the server to start a new session connection; 2) the server determines whether to generate a new master key based on the customer's information, if necessary, the server will contain the information required to generate the CMK when responding to the customer's "Hello" information. 3) the customer generates a CMK Based on the server response information received, the CMK is encrypted with the public key of the server and then transmitted to the server. 4) The server restores the CMK and returns the CMK authentication information to the customer to authenticate the server.


Https introduction HTTPS (Secure Hypertext Transfer Protocol) Secure Hypertext Transfer Protocol, developed by Netscape and built in its browser, is used to compress and decompress data, and return the result of network upload and return. HTTPS actually uses Netscape's full Socket Layer (SSL) as the child layer of the HTTP application layer. (HTTPS uses port 443 instead of using port 80 as HTTP to communicate with TCP/IP .) SSL uses 40-bit keywords as the RC4 stream encryption algorithm, which is suitable for business information encryption. HTTPS and SSL support X.509 digital authentication. If necessary, you can confirm who the sender is.
Https is an HTTP channel targeted at security. It is simply a secure version of HTTP. That is, the SSL layer is added under HTTP. The Security Foundation of https is SSL. For details about encryption, see SSL.

OpenSSL is included in RHEL5.
1. Generate the certificate cd/etc/httpd
[Root @ www httpd] # openssl genrsa-out server. key 1024
Generating RSA private key, 1024 bit long modulus
... ++
........................................ ..................... ++
E is 65537 (0x10001)
2. Sign the key [
Root @ www httpd] # chmod 600 server. key
[Root @ www httpd] # openssl req-new-key server. key-out server. csr
You are about to be asked to enter information that will be ininitialized
Into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]: CN
State or Province Name (full name) [Berkshire]: China
Locality Name (eg, city) [Newbury]: Shanghai
Organization Name (eg, company) [My Company Ltd]: linuxdify
Organizational Unit Name (eg, section) []: linuxdify
Common Name (eg, your name or your server's hostname) []: www.linuxdify.com
Email Address []: root@linuxdify.com

Please enter the following 'extra 'attributes
To be sent with your certificate request
A challenge password []: 1234
A optional company name []: 1234

3. Define the validity period
[Root @ www httpd] # openssl x509-req-days 365-in server. csr-signkey server. key-out server. crt
Signature OK
Subject =/C = CN/ST = China/L = Shanghai/O = linuxdify/OU = linuxdify/CN = www.linuxdify.com/emailAddress=root@linuxdify.com
Getting Private key

4. Call SSL
Check whether there is ssl. conf In the httpd/conf. d directory. If not, install mod_ssl (I use yum install mod_ssl ).

# Vi/etc/httpd/conf. d/ssl. conf
SSLCertificateFile/etc/httpd/server. crt
SSLCertificateKeyFile/etc/httpd/server. key


# General setup for the virtual host, inherited from global configuration
# DocumentRoot "/var/www/html"
# ServerName www.example.com: 443

DocumentRoot "/var/www/html/www.linuxdify.com"
ServerName www.linuxdify.com: 443

Restart the httpd service.

I open the browser and enter https://www.linuxdify.com
Tip:
Www.linuxdify.com uses an invalid security certificate.

The certificate is not trusted because it is self signed.

(Error code: sec_error_untrusted_issuer)

At this time, you need to obtain the certificate, with a prompt in the browser.

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.