Simple implementation of HTTPS (1) automatic implementation of SSL

Time:2021-2-25

As we all know, HTTP protocol is an insecure protocol, and HTTPS protocol is the abbreviation of HTTP over SSL / TLS, which means “use”SSL/TLSHTTP, also known as “hypertext transfer security protocol”. HTTP with SSL / TLS protocol can build encrypted transmission, identity authentication network protocol.

The pages before upgrading to HTTPS are as follows

Simple implementation of HTTPS (1) automatic implementation of SSL

Configure HTTPS

The default port of HTTPS is 443, which will be permanently added to the firewall white list.

sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
sudo firewall-cmd --reload

View open ports

sudo firewall-cmd --list-port
80/tcp 443/tcp

Install SSL module

sudo yum -y install mod_ssl

After installation, generate SSL configuration file in Apache configuration directory

/etc/httpd/conf.d/ssl.conf

Simple implementation of HTTPS (1) automatic implementation of SSL

As can be seen from the figure above, the corresponding private key and certificate are placed in the

/etc/pki/tls/private/localhost.key
/etc/pki/tls/certs/localhost.crt

Restart Apache service

sudo systemctl restart httpd

Access in browserhttps://lamp.test.comSimple implementation of HTTPS (1) automatic implementation of SSL

Click the red warning sign to find that the certificate is only valid for one year.

Simple implementation of HTTPS (1) automatic implementation of SSL

Since then, the automatic installation of SSL module has been used to implement the HTTPS.

This work adoptsCC agreementReprint must indicate the author and the link of this article

Recommended Today

Third party calls wechat payment interface

Step one: preparation 1. Wechat payment interface can only be called if the developer qualification has been authenticated on wechat open platform, so the first thing is to authenticate. It’s very simple, but wechat will charge 300 yuan for audit 2. Set payment directory Login wechat payment merchant platform( pay.weixin.qq . com) — > Product […]