66
SSL/TLS, certificates, ciphersuites... How does that work? [email protected] Linuxdays.cz, Prague, 2016

SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? [email protected] Linuxdays.cz, Prague,

  • Upload
    others

  • View
    5

  • Download
    1

Embed Size (px)

Citation preview

Page 1: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

SSL/TLS, certificates, ciphersuites...How does that work?

[email protected]

Linuxdays.cz, Prague, 2016

Page 2: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

<<Image:Library>>

Page 3: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

<<Image: Drug Dealing>>

Page 4: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,
Page 5: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,
Page 6: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

DNS

Internet

www.amazon.com54.239.17.6

54.239.17.6G

ET /

<html [...]

Page 7: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

DNS

Internet

www.amazon.com54.239.17.6

54.239.17.6

[ENCRYPTED]

[ENCRYPTED]

Page 8: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

SSLv3.1SSLv3SSLv2SSLv1

TLSv1 TLSv1.1 TLSv1.2 TLSv1.3(draft)

Time

TLS(Transport Layer Security)

SSL

(Secure Sockets Layer)

HTTP over SSL

wolfSSL

https://[...]

OpenSSL

HTTP over TLS HTTP Secure

MatrixSSL

LibreSSL

BoringSSL

GnuTLS

Page 9: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,
Page 10: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 11: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 12: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server;

# Redirect all HTTP requests to HTTPS with a 301 Moved # Permanently response. return 301 https://$host$request_uri;}

server { listen 443 ssl http2; listen [::]:443 ssl http2;

[ “ssl_” settings ]}

Page 13: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server;

# Redirect all HTTP requests to HTTPS with a 301 Moved # Permanently response. return 301 https://$host$request_uri;}

server { listen 443 ssl http2; listen [::]:443 ssl http2;

[ “ssl_” settings ]}

Page 14: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server;

# Redirect all HTTP requests to HTTPS with a 301 Moved # Permanently response. return 301 https://$host$request_uri;}

server { listen 443 ssl http2; listen [::]:443 ssl http2;

[ “ssl_” settings ]}

Page 15: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server;

# Redirect all HTTP requests to HTTPS with a 301 Moved # Permanently response. return 301 https://$host$request_uri;}

server { listen 443 ssl http2; listen [::]:443 ssl http2;

[ “ssl_” settings ]}

Page 16: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 17: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 18: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 19: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 20: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key;

Page 21: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key;

Page 22: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

CertificateAuthority

Page 23: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

CertificateAuthority

Page 24: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

CertificateAuthority

Page 25: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

CertificateAuthority

Page 26: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

CertificateAuthority

Page 27: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

CertificateAuthority

Page 28: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key;

Page 29: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key;

Page 30: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 31: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 32: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key;

Page 33: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 34: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# OCSP Stapling ---# fetch OCSP records from URL in ssl_certificate and cache themssl_stapling on;ssl_stapling_verify on;## verify chain of trust of OCSP response using Root CA and## Intermediate certsssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;resolver <IP DNS resolver>;

Page 35: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# OCSP Stapling ---# fetch OCSP records from URL in ssl_certificate and cache themssl_stapling on;ssl_stapling_verify on;## verify chain of trust of OCSP response using Root CA and## Intermediate certsssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;resolver <IP DNS resolver>;

Page 36: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# OCSP Stapling ---# fetch OCSP records from URL in ssl_certificate and cache themssl_stapling on;ssl_stapling_verify on;## verify chain of trust of OCSP response using Root CA and## Intermediate certsssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;resolver <IP DNS resolver>;

Page 37: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# OCSP Stapling ---# fetch OCSP records from URL in ssl_certificate and cache themssl_stapling on;ssl_stapling_verify on;## verify chain of trust of OCSP response using Root CA and## Intermediate certsssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;resolver <IP DNS resolver>;

Page 38: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# OCSP Stapling ---# fetch OCSP records from URL in ssl_certificate and cache themssl_stapling on;ssl_stapling_verify on;## verify chain of trust of OCSP response using Root CA and## Intermediate certsssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;resolver <IP DNS resolver>;

Page 39: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 40: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 41: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 42: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# Diffie-Hellman parameter for DHE ciphersuites,# recommended 2048 bitsssl_dhparam /path/to/dhparam.pem;# modern configuration. tweak to your needs.ssl_protocols TLSv1.2;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';ssl_prefer_server_ciphers on;

Page 43: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# Diffie-Hellman parameter for DHE ciphersuites,# recommended 2048 bitsssl_dhparam /path/to/dhparam.pem;# modern configuration. tweak to your needs.ssl_protocols TLSv1.2;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';ssl_prefer_server_ciphers on;

Page 44: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# Diffie-Hellman parameter for DHE ciphersuites,# recommended 2048 bitsssl_dhparam /path/to/dhparam.pem;# modern configuration. tweak to your needs.ssl_protocols TLSv1.2;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';ssl_prefer_server_ciphers on;

Page 45: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

● 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

Page 46: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

Handshaking Bulk Encryption Hash

Page 47: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

● ECDHE-ECDSA● ECDHE-RSA

Handshaking Bulk Encryption Hash

● AES-256-GCM● CHACHA20● AES-256● AES-128● AES-128-GCM

● SHA256● SHA384● POLY1305

Page 48: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

● ECDHE-ECDSA● ECDHE-RSA● ECDH-ECDSA● DHE-RSA● DH-RSA● RSA

Handshaking Bulk Encryption Hash

● AES-256-GCM● CHACHA20● AES-256● AES-128● AES-128-GCM● AES-256-CBC● DES-CBC3

● SHA256● SHA384● POLY1305● SHA● MD5

Anything„DHE“

CHACHA20or anything

„GCM“

SHA256,SHA384,

POLY1305

Page 49: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# Diffie-Hellman parameter for DHE ciphersuites,# recommended 2048 bitsssl_dhparam /path/to/dhparam.pem;# modern configuration. tweak to your needs.ssl_protocols TLSv1.2;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';ssl_prefer_server_ciphers on;

Page 50: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# Diffie-Hellman parameter for DHE ciphersuites,# recommended 2048 bitsssl_dhparam /path/to/dhparam.pem;# modern configuration. tweak to your needs.ssl_protocols TLSv1.2;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';ssl_prefer_server_ciphers on;

Page 51: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# Diffie-Hellman parameter for DHE ciphersuites,# recommended 2048 bitsssl_dhparam /path/to/dhparam.pem;# modern configuration. tweak to your needs.ssl_protocols TLSv1.2;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';ssl_prefer_server_ciphers on;

Page 52: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 53: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 54: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 55: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

ssl_session_timeout 1d;ssl_session_cache shared:SSL:50m;ssl_session_tickets off;

Page 56: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

ssl_session_timeout 1d;ssl_session_cache shared:SSL:50m;ssl_session_tickets off;

Page 57: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

ssl_session_timeout 1d;ssl_session_cache shared:SSL:50m;ssl_session_tickets off;

Page 58: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

ssl_session_timeout 1d;ssl_session_cache shared:SSL:50m;ssl_session_tickets off;

Page 59: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 60: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 61: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 62: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

# HSTS (ngx_http_headers_module is required)# (15768000 seconds = 6 months)add_header Strict-Transport-Security max-age=15768000;

Page 63: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 64: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

server { listen 80 default_server; listen [::]:80 default_server; # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. return 301 https://$host$request_uri;}server { listen 443 ssl http2; listen [::]:443 ssl http2; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /path/to/signed_cert_plus_intermediates; ssl_certificate_key /path/to/private_key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /path/to/dhparam.pem; # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; 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'; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates; resolver <IP DNS resolver>; ....}

Page 65: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

Summary

● Getting basic SSL up: Simple● Tuning SSL: A bit harder● TLSv1.2● Ciphersuite

„DHE“ - (CHACHA20 or „GCM“) - (POLY1305, SHA256, SHA384)

Feedback → [email protected]

Page 66: SSL/TLS, certificates, ciphersuites How does that work? · 2016. 10. 17. · SSL/TLS, certificates, ciphersuites... How does that work? linuxdays-2016@lirum.at Linuxdays.cz, Prague,

● https://mozilla.github.io/server-side-tls/ssl-config-generator/

● https://phabricator.wikimedia.org/diffusion/OPUP/browse/production/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb

● https://wiki.mozilla.org/Security/Server_Side_TLS

● https://wiki.mozilla.org/Security/Guidelines/Web_Security

● https://www.owasp.org/index.php/List_of_useful_HTTP_headers#tab=Headers

● https://commons.wikimedia.org/wiki/File:Bookshop_Interior_-_Subarnarekha_-_Hirabai_Panthasala_-_Santiniketan_2014-06-28_5206.JPG (CC-BY Biswarup Ganguly)

● http://www.pointsincase.com/wp-content/uploads/2008/05/drug-dealer.jpg

● https://commons.wikimedia.org/wiki/File:Ambox_padlock_gray.svg (PD)