TLS

Definition

Transport Layer Security (TLS) is a cryptographic protocol designed to provide secure communication over a computer network. It ensures data privacy and integrity between two communicating applications by encrypting the data transmitted. TLS is widely used in web browsers, email, messaging, and other applications requiring secure data exchange. It is the successor to the now-deprecated Secure Sockets Layer (SSL) protocol.

Secure Settings Example

# Example of a secure TLS configuration in an Nginx server block
server {
    listen 443 ssl;
    server_name example.com;

    ssl_certificate /etc/ssl/certs/example.com.crt;
    ssl_certificate_key /etc/ssl/private/example.com.key;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384';
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
}

Insecure Settings Example

# Example of an insecure TLS configuration in an Nginx server block
server {
    listen 443 ssl;
    server_name example.com;

    ssl_certificate /etc/ssl/certs/example.com.crt;
    ssl_certificate_key /etc/ssl/private/example.com.key;

    ssl_protocols SSLv3 TLSv1 TLSv1.1;  # Insecure protocols
    ssl_ciphers 'RC4:DES:3DES:MD5';     # Weak ciphers
    ssl_prefer_server_ciphers off;
    ssl_session_cache off;
}