In questo tutorial imparerai come Activezi TLSV1.3 o NGINX. Cosa significa TLSv 1.3, Cosa aiuta E perché hai bisogno sul server web CA TLS può essere attivato. Per server con sistema di gestione Vestacp (Centos o ubuntu) è un po 'più difficile di Activat TLS 1.3 Solo su un server con CPanel, ma non è impossibile.
contenuto
Perché TLS 1.3 è migliore di TLS 1.2?
TLS (Transport Layer Security) È un Protocollo crittografico che assicura Sicurezza della connessione tra il computer e una rete a cui appartiene. TLS viene utilizzato in applicazioni come: e-mail, messaggero, Chiamate vocali e video (VoIP), ma soprattutto a HTTPS. Garantire una comunicazione sicura tra il computer o lo smartphone dell'utente e il server Web della pagina accessibile.
TLS 1.3 offre o velocità più alta di connessione client – server e uno più sicurezza eliminando gli algoritmi. Le differenze tra TLSV1.2 e TLSV1.3.
Di HTTPS, SSL (Secure Sockets Layer) Ho anche detto in altri articoli:
- Come installiamo SSL (connessione HTTPS) certificata per un sito Web Hostat su un server NGINX senza CPanel o VestaCP
- RECOMPIlare OpenSSL 1.1 & Ningin 1.25 per TLS 1.3 (centOS 7)
- Come spostare un blog o un sito Web WordPress da HTTP a HTTPS (NGINX)
- Elimina i certificati CERTBOT di Old Domains (certificato di crittografia)
Come si attiva TLS 1.3 su ninx. Server con gestione VestaCP / CentOS
Prima di vedere come attivi TLSV1.3 su NGINX, è necessario considerare alcuni requisiti minimi per TLS 1.3.
- Ningin 1.13.x o una versione più recente
- Un certificato TLS valido
- Nome di dominio attivo con DNS configurato correttamente – Sii accessibile su Internet
- Un certificato TLS / SSL valido. Può essere Let’s Encrypt.
Su VestaCP installato molto tempo fa abbiamo solo il protocollo TLS 1.2. Ho visto in molti tutorial che è sufficiente come in nginx.conf Aggiungiamo la seguente riga per l'attivazione di 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;
Falso. Se su un server CentOS CU Management Vestacp, Ningx non è stato compilato Con la versione minima OpenSSL 1.1.1.1, ssl_protocols TLSv1.2 TLSv1.3; In nginx.conf .. non aiuta con nulla.
[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, nell'esempio sopra NGINX 1.22.0 è compatibile con la versione TLS 1.3, ma non aiuta la libreria OpenSSL 1.0.2k-fips.
Per attivare TLSV1.3 su NGINX, è necessario prima installare le librerie per i pacchetti dell'infanzia e dello sviluppo. Development Tools. Esegui nelle righe di comando CentOS 7:
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. Installa l'ultima versione OpenSSL
In questo momento la versione più recente è OpenSSL 1.1.1p, ma da quello che ho notato ci sono già OpenNSl 3. Trovi le fonti su Opensssl.org.
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
Molto importante da correre make test Prima di installare la libreria. Se si sono verificati errori nel test, non eseguire make install fino a quando gli errori non vengono corretti.
Al passaggio successivo facciamo un backup al file binario corrente openssl e aggiungo symlink a quello nuovo.
mv /usr/bin/openssl /usr/bin/openssl-backup
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
In /usr/local/openssl/bin eseguire ldd Per verificare le dipendenze OpenSSL. Possiamo anche verificare la versione OpenSL. Comando openssl version.
[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
In questo momento abbiamo l'ultima versione installata OpenSSL che supporta TLSv1.3. Possiamo controllare le versioni TLS / SSL Supportato dai bibliotecari OpenSSL per ordine:
[root@north bin]# openssl ciphers -v | awk '{print $2}' | sort | uniq
SSLv3
TLSv1
TLSv1.2
TLSv1.3
[root@north bin]#
Ciò non significa che i siti Web ospitati con l'aiuto del manager VestaCP Lo avranno immediatamente TLS 1.3.
Anche se abbiamo installato OpenSSL 1.1.1p, Nginx è compilato con la vecchia versione OpenSSL 1.0.2k-fips.
[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
In questo passaggio dobbiamo raccomandarci OpenSSL La versione Nginx già installata sul sistema CentOS / VestaCP. Come ho detto sopra, nel mio caso si tratta nginx/1.22.0. Essere su un server web che ha VestaCP Sistema di amministrazione, prima di avviare la ricompilazione, è bene eseguire il backup dei file NGINX.
Backup NINGX corrente sul sistema VestaCP
Archiviare e tenere da qualche parte sul server i registi “/etc/nginx” E “/usr/local/vesta/nginx“.
CORRERE nginx -V e salva in un file moduli esistenti.
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'

Come ricevere ninx per upgrage opensl / centos 7
Ripeto. Se hai Vestacp, Scarica la versione Nginx che hai già installato. Tutti gli archivi con le versioni Nginx li trovi nginx.org.
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
Ripliciamo i moduli Nginx:
./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
Ora abbiamo installato e compilato Ningx con l'ultima versione di OpenSSL in grado di supportare 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
*Se Nginx era già installato sul server, dovrai disinstallarlo. La compilation non funziona al numero di NINX di aggiornamento.
Come si attiva tlsv1.3 per campi su vestACP
Nel file /etc/nginx/nginx.conf Aggiungiamo le seguenti righe:
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';
A livello di domini ho cambiato qualcosa nei modelli VestaCP e per attivare HTTP/2. Quindi, quando si aggiunge un nuovo dominio (Esempio.com) con l'attivazione di let's Cript, ho il seguente file di configurazione SSL:
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';
Prima di riavviare NGINX, è buono prima di testare la sua configurazione.
[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
Spero che questo tutorial ti sia utile e, se non ci riesci, lasciare i dettagli del problema nei commenti.