Šajā apmācībā jūs uzzināsit, kā Activezi tlsv1.3 vai nginxApvidū Ko tas nozīmē TLSv 1.3Verdzība Kas palīdz Un kāpēc jums vajag tīmekļa servera CA TLS var aktivizētApvidū Serveriem ar pārvaldības sistēmu Vestacp (Centos vai Ubuntu) ir nedaudz grūtāk Actiat TLS 1.3 Tikai serverī ar CPANEL, bet tas nav neiespējami.
apmierināts
Kāpēc TLS 1,3 ir labāks par TLS 1.2?
TLS (Transport Layer Security) Tas ir a kriptogrāfijas protokols Kas nodrošina Savienojuma drošība starp datoru un tīklu, kas tam pieder. TLS tiek izmantots tādās lietojumprogrammās kā: e -pastsVerdzība kurjersVerdzība Balss un videozvani (VoIP), bet it īpaši plkst HTTPSApvidū Nodrošinot drošu saziņu starp lietotāja datoru vai viedtālruni un piekļuves lapas tīmekļa serveri.
TLS 1.3 Piedāvā o lielāks ātrums klienta savienojuma – serveris un viens Plus drošība izslēdzot algoritmus. Atšķirības starp tlsv1.2 un tlsv1.3Apvidū
Pret HTTPSVerdzība SSL (Secure Sockets Layer) Es arī teicu citos priekšmetos:
- Kā mēs instalējam SSL (HTTPS savienojumu), kas sertificēts hostat vietnei NGINX serverī bez CPANEL vai VestACP
- Recompilare OpenSsl 1.1 & Ningin 1,25 par TLS 1,3 (Centos 7)
- Kā pārvietot emuāru vai WordPress vietni no HTTP uz HTTPS (NGINX)
- Dzēst veco domēnu sertifikāta sertifikātus (Let’s Encrypt sertifikāts)
Kā jūs aktivizējat TLS 1.3 uz Ninx. Serveris ar vestacp / centos pārvaldību
Pirms redzat, kā jūs aktivizējat TLSV1.3 uz NGINX, jums jāņem vērā dažas minimālās prasības TLS 1.3Apvidū
- Ningin 1.13.x vai jaunāka versija
- Derīgs TLS sertifikāts
- Domēna nosaukums ir aktīvs ar DNS, kas ir pareizi konfigurēts – jābūt pieejamam internetā
- Derīgs TLS / SSL sertifikāts. Tas var būt Let’s EncryptApvidū
Vestacp, kas uzstādīts jau sen, mums ir tikai protokols TLS 1.2Apvidū Es daudzās apmācībās redzēju, ka ar to ir pietiekami kā nginx.conf Pievienosim šādu rindu, lai aktivizētu TLS 1.3:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com;
root /var/www/example.com/public;
ssl_certificate /path/to/your/certificate.crt;
ssl_certificate_key /path/to/your/private.key;
ssl_protocols TLSv1.2 TLSv1.3;
Nepatiess. Ja uz servera Centos Cu vadība VestacpVerdzība Ningx nav apkopots ar minimālo versiju OpenSSL 1.1.1.1Verdzība ssl_protocols TLSv1.2 TLSv1.3; iekšā nginx.conf .. tas neko nepalīdz.
[root@north ~]# nginx -V
nginx version: nginx/1.22.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
Asar, iepriekšminētajā piemērā NGINX 1.22.0 ir savietojams ar TLS 1.3 versiju, bet nepalīdz grāmatnīcai OpenSSL 1.0.2k-fipsApvidū
Lai aktivizētu TLSV1.3 NGINX, vispirms jāinstalē grāmatnīcas bērnības un attīstības paketēm. Development ToolsApvidū Izpilda Centos 7 komandrindas:
yum install gcc gcc-c++ pcre-devel zlib-devel make unzip gd-devel perl-ExtUtils-Embed libxslt-devel openssl-devel perl-Test-Simple
yum groupinstall 'Development Tools'
1. Instalējiet jaunāko versiju OpenSSL
Šajā laikā jaunākā versija ir OpenSSL 1.1.1p, bet no tā, ko es pamanīju, jau ir OpenNSL 3. Jūs atrodat avotus Openssl.orgApvidū
cd /usr/src
wget https://www.openssl.org/source/openssl-1.1.1p.tar.gz
tar xvf openssl-1.1.1p.tar.gz
mv openssl-1.1.1p openssl
cd openssl
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl --libdir=/lib64 shared zlib-dynamic
make -j4
make test
make install
Ļoti svarīgi skriet make test Pirms grāmatnīcas instalēšanas. Ja testā ir notikušas kļūdas, neskrieniet make install līdz kļūdas nav labotas.
Nākamajā posmā mēs veicam dublējumu pašreizējam binārajam failam openssl un es pievienoju symlink uz jauno.
mv /usr/bin/openssl /usr/bin/openssl-backup
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
Iekšā /usr/local/openssl/bin izpildīt ldd Lai pārbaudītu OpenSSL atkarības. Mēs varam arī pārbaudīt OpenSL versiju. Vadība openssl versionApvidū
[root@north bin]# ldd openssl
linux-vdso.so.1 => (0x00007ffd20bd7000)
libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007fab09b62000)
libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007fab09675000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fab09471000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fab09255000)
libc.so.6 => /lib64/libc.so.6 (0x00007fab08e87000)
/lib64/ld-linux-x86-64.so.2 (0x00007fab09df5000)
[root@north bin]# openssl version
OpenSSL 1.1.1p 21 Jun 2022
Šajā laikā mums ir instalēta jaunākā versija OpenSSL kas atbalsta TLSv1.3Apvidū Mēs varam pārbaudīt versijas TLS / SSL Atbalstīja bibliotekāri OpenSSL pēc pasūtījuma:
[root@north bin]# openssl ciphers -v | awk '{print $2}' | sort | uniq
SSLv3
TLSv1
TLSv1.2
TLSv1.3
[root@north bin]#
Tas nenozīmē, ka vietnes, kas mitinātas ar vadītāja palīdzību VestaCP Viņiem būs nekavējoties TLS 1.3Apvidū
Lai gan mēs esam instalējuši OpenSSL 1.1.1p, Nginx tiek apkopots ar veco versiju OpenSSL 1.0.2k-fipsApvidū
[root@north bin]# nginx -V
nginx version: nginx/1.22.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'
[root@north bin]# openssl version
OpenSSL 1.1.1p 21 Jun 2022
[root@north bin]#
2. VestaCP
Šajā solī mums ir jāatspoguļo OpenSSL NGINX versija jau ir instalēta par sistēmu CentOS / VestaCPApvidū Kā jau teicu iepriekš, manā gadījumā tas ir par nginx/1.22.0Apvidū Par tīmekļa serveri, kuram ir VestaCP Administrēšanas sistēma, pirms mēs sākam kompilāciju, ir labi dublēt NGINX failus.
Rezerves nginx strāva sistēmā VestaCP
Arhivs un turiet kaut kur servera direktoros “/etc/nginx” un “/usr/local/vesta/nginx“Apvidū
Izkropļot nginx -V un saglabāt failā esošos moduļus.
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

Kā saņemt adresātu NINX, lai uzlabotu Opensl / CentOS 7
Es atkārtoju. Ja jums ir Vestacp, Lejupielādējiet jau instalēto NGINX versiju. Visi arhīvi ar NGINX versijām, kuras jūs tās atrodat nginx.orgApvidū
cd /usr/src
wget https://nginx.org/download/nginx-1.22.0.tar.gz
tar xvf nginx-1.22.0.tar.gz
cd nginx-1.22.0
Mēs atkārtojam nginx moduļus:
./configure --prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib64/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--user=nginx \
--group=nginx \
--with-compat \
--with-file-aio \
--with-threads \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_mp4_module \
--with-http_random_index_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_slice_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_v2_module \
--with-mail \
--with-mail_ssl_module \
--with-stream \
--with-stream_realip_module \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-openssl=/usr/src/openssl \
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong \
--param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' \
--with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'
make -j4
make install
Mēs tagad esam instalējuši un apkopoti ar jaunāko versiju OpenSSL spēj atbalstīt tlsv1.3.
[root@north bin]# nginx -V
nginx version: nginx/1.22.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.1.1p 21 Jun 2022
TLS SNI support enabled
*Ja NGINX jau bija instalēts serverī, jums tas būs jāatstāj. Kompilācija nedarbojas jaunināšanā NINX.
Kā jūs aktivizējat tlsv1.3 laukiem uz vestacp
Failā /etc/nginx/nginx.conf Mēs pievienojam šādas līnijas:
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
Domēnu līmenī es kaut ko mainīju veidnēs Vestacp un aktivizēt http/2Apvidū Tātad, pievienojot jaunu domēnu (piemērs.com) ar aktivizētu Let's Encrypt, man ir šāds SSL konfigurācijas fails:
cat /home/vestacpuser/conf/web/example.com.nginx.ssl.conf
server {
listen IP.IP.IP.IP:443 ssl http2;
server_name example.com www.example.com;
root /home/vestacpuser/web/example.com/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/example.com.log combined;
access_log /var/log/nginx/domains/example.com.bytes bytes;
error_log /var/log/nginx/domains/example.com.error.log error;
ssl_certificate /home/vestacpuser/conf/web/ssl.example.com.pem;
ssl_certificate_key /home/vestacpuser/conf/web/ssl.example.com.key;
....
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
Pirms restartēšanas NGINX, tas ir labi, pirms pārbaudāt tā konfigurāciju.
[root@north web]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@north web]# systemctl restart nginx
Es ceru, ka šī apmācība jums ir noderīga, un, ja jums neizdodas, komentāros atstājiet sīkāku informāciju par problēmu.