SlideShare a Scribd company logo
DEBUGGING
FRONT-END PERFORMANCE
Tim Kadlec (@tkadlec) & Pat Meenan (@patmeenan)
June 20-21, 2016 at Velocity Conference (#velocityconf)
TLS
https://en.wikipedia.org/wiki/Internet_censorship_and_surveillance_by_country
http://www.bidnessetc.com/39369-verizon-communications-inc-tracking-supercookie-under-review-by-fcc/
http://arstechnica.com/tech-policy/2013/04/how-a-banner-ad-for-hs-ok/
https://security.googleblog.com/2014/08/https-as-ranking-signal_6.html
https://www.chromium.org/Home/chromium-security/marking-http-as-non-secure
• Service Workers
• HTTP/2
• Geo Location
• All new “powerful” web features
• Chrome and Firefox
REQUIRING HTTPS FOR…
https://hpbn.co/https://www.igvita.com/
@igrigorik
TLS handshake 101
Certificate verification
(asymmetric crypto)
Symmetric key
negotiation
encrypted app
data
2
RTTs
1 RTT HANDSHAKE
TLS resumption 101
Re-use negotiated
parameters for the
symmetric cipher
● Eliminates asymmetric crypto on the server via reuse of previously used parameters
● Eliminates full roundtrip, allowing 1-RTT connection establishment
TLS resumption
Session identifiers
● Server assigns session ID
● Server caches parameters
● Client sends session ID
● Session is “resumed”
Session tickets
● Server encrypts parameters
● Server sets opaque ticket
● Client sends opaque ticket
● Server decrypts ticket and resumes session
Shared state is on the
server
Shared state is on the
client
A few things to think about…
1. Session identifiers
a. Require a shared cache between servers for best results
b. Sessions must be expired and rotated in a secure manner
1. Session tickets
a. Require a shared ticket encryption key
b. Shared encryption key must be rotated in a secure manner
1. Perfect Forward Secrecy (PFS)
“Session ticket keys have to be distributed to all the frontend machines,
without being written to any kind of persistent storage, and frequently
rotated.”
https://www.imperialviolet.org/2011/11/22/forwardsecret.html
CDNs are not just for static
content.
Edge termination can significantly
reduce TCP and TLS handshake
costs!
Terminate TLS at the CDN edge...
RTT with
origin
RTT with CDN edge
*Before you hand over the keys to your
kingdom, make your your CDN has their
TLS stack optimized! You may be
surprised...
Online Certificate Status Protocol (OCSP)
Stop the world and query the OCSP server
● DNS lookup
● TCP connect
● Wait for server response
What if the OCSP check times out, gets blocked, etc? See “Revocation still doesn’t work.”
Has this certificate been
revoked?
● Chrome blocks on EV certs only
● Other browsers may block on all (FF)
Eliminating OCSP latency
OCSP endpoint
Use OCSP stapling!
1. Server retrieves the OCSP response
2. Server “staples” response to certificate
3. Client verifies stapled response
TLS handshake with stapled OCSP response...
$> openssl s_client -connect example.com:443 -tls1 -tlsextdebug -status
OCSP Response Data:
OCSP Response Status: successful (0x0)
Response Type: Basic OCSP Response
Version: 1 (0x0)
Responder Id: C = IL, O = StartCom Ltd., CN = StartCom Class 1 Server OCSP Signer
Produced At: Feb 18 17:53:53 2014 GMT
Responses:
Certificate ID:
Hash Algorithm: sha1
Issuer Name Hash: 6568874F40750F016A3475625E1F5C93E5A26D58
Issuer Key Hash: EB4234D098B0AB9FF41B6B08F7CC642EEF0E2C45
Serial Number: 0B60D5
Cert Status: good
Stapled OCSP means no
blocking!
OCSP stapling increases certificate size! Is this a problem for your site? Better check.
How many RTTs does your certificate incur?
● Average certificate chain depth: 2-3 certificates
● Average certificate size: ~1~1.5KB
● Plus OCSP response…
● Many cert chains overflow the old TCP (4 packet) CWND
● Upgrade your servers to use IW10!
3+ RTT TLS handshake due to 2
RTT cert?
Check your server, you may be surprised...
● Capture a tcpdump of your handshake and check the exchange
● Some servers will pause on “large certificates” until they get an ACK for the
first 4KB of the certificate (doh!)
nginx <1.5.6, HAProxy <1.5-dev22 incur extra RTT, even w/
IW10!
1-RTT non-resumed handshake with TLS False Start
Client sends application data
immediately after “Finished”.
● Eliminates 1RTT
● No protocol changes...
● Only timing is affected
In practice…
● Some servers break (ugh)
● Hence, opt-in behavior...
Deploying False Start...
● Chrome and Firefox
Chrome and Firefox
● ALPN advertisement - e.g. “http/1.1”
● Forward secrecy ciphersuite - e.g. ECDHE
Safari
● Forward secrecy ciphersuite
Internet Explorer
● Blacklist + timeout
● If handshake fails, retry without False Start
TL;DR: enable ALPN advertisement and forward secrecy to get 1RTT
handshakes.
Ingredients for a 1-RTT TLS experience…
1. False Start = 1-RTT handshake for new visitors
a. New users have to perform public-key crypto handshake
1. Session resumption = 1-RTT handshake for returning visitors
a. Plus, we can skip public-key crypto by reusing previous parameters
1. OCSP Stapling
a. No OCSP blocking to verify certificate status
1. False Start + Session Resumption + OCSP stapling
a. 1-RTT handshake for new and returning visitors
b. Returning visitors can skip the public-key crypto
What’s wrong with this picture?
300ms RTT, 1.5Mbps...
● It’s a 2-RTT time to first byte!
Large records are buffered, which delays processing!
● It’s a 2-RTT handshake… we know better!
o At least there is no OSCP overhead!
TLS record size + latency gotchas...
This record is split across 8 TCP
packets
TLS allows up to 16KB of application per record
● New connection + 16KB record = CWND overflow and an extra RTT
● Lost or delayed packet delays processing of entire record
Optimizing record size…
1. Google servers implement dynamic record sizing
a. New connections start with 1400 byte records (aka, single MTU)
b. After ~1MB is sent, switch to 16K records
c. After ~1s of inactivity, reset to 1400 byte records
1. Most servers don’t optimize this case at all...
a. HAProxy recently landed dynamic sizing patch - yay!
b. Nginx landed ssl_buffer_size: static override - better, but meh...
c. Cloudflare released patch for Nginx dynamic record sizing
TL;DR: there is no “perfect record size”. Adjust dynamically.
Quick sanity check...
theory is great, but does this all work in
practice?
Tuning Nginx TLS Time To First Byte (TTTFB)
● Pre 1.5.7: bug for 4KB+ certs, resulting in 3RTT+ handshakes
● 1.7.1 added ssl_buffer_size: 4KB record size remove an RTT
● 1.7.1 with NPN and forward secrecy → 1RTT handshake
https://www.igvita.com/2013/12/16/optimizing-nginx-tls-time-to-first-byte/
https://istlsfastyet.com/#server-performance
https://istlsfastyet.com/#cdn-paas
isTLSfastyet.com
MORE HTTPS
DEBUGGING
• HTTP Response header
Content-Security-Policy-Report-Only:
default-src https:;
report-uri http://reportcollector.example.com/collector.cgi
CSP VIOLATION REPORTS
• Server response header
o Strict-Transport-Security: max-age=15768000;
includeSubDomains; preload
• Chrome/Firefox preload list
STRICT TRANSPORT SECURITY - HSTS
• Reducing/Reporting MITM attacks
• Server response header
o Public-Key-Pins:
o report-uri=https://example.net/pkp-report
• Doesn’t apply to “local trust anchors” 
• Chrome, Firefox, Opera
KEY PINNING - HPKP
THANK YOU!
Tim Kadlec (@tkadlec) & Pat Meenan (@patmeenan)
June 20-21, 2016 at Velocity Conference (#velocityconf)
Icons courtesy of The Noun Project

More Related Content

What's hot

Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
JeongHun Byeon
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
David Lindkvist
 
Measuring Continuity
Measuring ContinuityMeasuring Continuity
Measuring Continuity
Nicholas Jansma
 
Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSockets
Roland M
 
HTTP 2.0 – What do I need to know?
HTTP 2.0 – What do I need to know? HTTP 2.0 – What do I need to know?
HTTP 2.0 – What do I need to know?
Sigma Software
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
Fastly
 
Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...
Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...
Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...
Fastly
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
Ericom Software
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
Gunnar Hillert
 
Defeating The Network Security Infrastructure V1.0
Defeating The Network Security Infrastructure  V1.0Defeating The Network Security Infrastructure  V1.0
Defeating The Network Security Infrastructure V1.0
Philippe Bogaerts
 
Apache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validationsApache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validations
Jean-Frederic Clere
 
Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015
Rakesh Chaudhary
 
Nginx Scalable Stack
Nginx Scalable StackNginx Scalable Stack
Nginx Scalable Stack
Bruno Paiuca
 
Websocket protocol overview
Websocket protocol overviewWebsocket protocol overview
Websocket protocol overview
allenmeng
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
timbc
 
Altitude SF 2017: Logging at the edge
Altitude SF 2017: Logging at the edgeAltitude SF 2017: Logging at the edge
Altitude SF 2017: Logging at the edge
Fastly
 
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
Jxck Jxck
 
Fluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting realFluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting real
Akamai Developers & Admins
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
GWTcon
 
Reliably Measuring Responsiveness
Reliably Measuring ResponsivenessReliably Measuring Responsiveness
Reliably Measuring Responsiveness
Nicholas Jansma
 

What's hot (20)

Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
 
Measuring Continuity
Measuring ContinuityMeasuring Continuity
Measuring Continuity
 
Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSockets
 
HTTP 2.0 – What do I need to know?
HTTP 2.0 – What do I need to know? HTTP 2.0 – What do I need to know?
HTTP 2.0 – What do I need to know?
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...
Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...
Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
Defeating The Network Security Infrastructure V1.0
Defeating The Network Security Infrastructure  V1.0Defeating The Network Security Infrastructure  V1.0
Defeating The Network Security Infrastructure V1.0
 
Apache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validationsApache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validations
 
Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015
 
Nginx Scalable Stack
Nginx Scalable StackNginx Scalable Stack
Nginx Scalable Stack
 
Websocket protocol overview
Websocket protocol overviewWebsocket protocol overview
Websocket protocol overview
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
 
Altitude SF 2017: Logging at the edge
Altitude SF 2017: Logging at the edgeAltitude SF 2017: Logging at the edge
Altitude SF 2017: Logging at the edge
 
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
 
Fluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting realFluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting real
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
 
Reliably Measuring Responsiveness
Reliably Measuring ResponsivenessReliably Measuring Responsiveness
Reliably Measuring Responsiveness
 

Viewers also liked

Machine Learning RUM - Velocity 2016
Machine Learning RUM - Velocity 2016Machine Learning RUM - Velocity 2016
Machine Learning RUM - Velocity 2016
Patrick Meenan
 
Scaling Front-End Performance - Velocity 2016
Scaling Front-End Performance - Velocity 2016Scaling Front-End Performance - Velocity 2016
Scaling Front-End Performance - Velocity 2016
Patrick Meenan
 
Service workers - Velocity 2016 Training
Service workers - Velocity 2016 TrainingService workers - Velocity 2016 Training
Service workers - Velocity 2016 Training
Patrick Meenan
 
Service Workers for Performance
Service Workers for PerformanceService Workers for Performance
Service Workers for Performance
Patrick Meenan
 
Measuring the visual experience of website performance
Measuring the visual experience of website performanceMeasuring the visual experience of website performance
Measuring the visual experience of website performance
Patrick Meenan
 
Selecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutionsSelecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutions
Patrick Meenan
 
Front-End Single Point of Failure - Velocity 2016 Training
Front-End Single Point of Failure - Velocity 2016 TrainingFront-End Single Point of Failure - Velocity 2016 Training
Front-End Single Point of Failure - Velocity 2016 Training
Patrick Meenan
 
WebPagetest Power Users - Velocity 2014
WebPagetest Power Users - Velocity 2014WebPagetest Power Users - Velocity 2014
WebPagetest Power Users - Velocity 2014
Patrick Meenan
 
Velocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and you
Patrick Meenan
 
Fail Well
Fail WellFail Well
Fail Well
Joshua Simmons
 
Service workers
Service workersService workers
Service workers
jungkees
 
Measuring performance - Velocity 2016 Training
Measuring performance - Velocity 2016 TrainingMeasuring performance - Velocity 2016 Training
Measuring performance - Velocity 2016 Training
Patrick Meenan
 
Web Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsWeb Page Test - Beyond the Basics
Web Page Test - Beyond the Basics
Andy Davies
 
Opticon 2015-Pushing the Boundaries of Optimizely
Opticon 2015-Pushing the Boundaries of OptimizelyOpticon 2015-Pushing the Boundaries of Optimizely
Opticon 2015-Pushing the Boundaries of Optimizely
Optimizely
 
Velocity Based Training
Velocity Based TrainingVelocity Based Training
Velocity Based Training
Mike Young
 
Debugging Distributed Systems - Velocity Santa Clara 2016
Debugging Distributed Systems - Velocity Santa Clara 2016Debugging Distributed Systems - Velocity Santa Clara 2016
Debugging Distributed Systems - Velocity Santa Clara 2016
Donny Nadolny
 

Viewers also liked (16)

Machine Learning RUM - Velocity 2016
Machine Learning RUM - Velocity 2016Machine Learning RUM - Velocity 2016
Machine Learning RUM - Velocity 2016
 
Scaling Front-End Performance - Velocity 2016
Scaling Front-End Performance - Velocity 2016Scaling Front-End Performance - Velocity 2016
Scaling Front-End Performance - Velocity 2016
 
Service workers - Velocity 2016 Training
Service workers - Velocity 2016 TrainingService workers - Velocity 2016 Training
Service workers - Velocity 2016 Training
 
Service Workers for Performance
Service Workers for PerformanceService Workers for Performance
Service Workers for Performance
 
Measuring the visual experience of website performance
Measuring the visual experience of website performanceMeasuring the visual experience of website performance
Measuring the visual experience of website performance
 
Selecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutionsSelecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutions
 
Front-End Single Point of Failure - Velocity 2016 Training
Front-End Single Point of Failure - Velocity 2016 TrainingFront-End Single Point of Failure - Velocity 2016 Training
Front-End Single Point of Failure - Velocity 2016 Training
 
WebPagetest Power Users - Velocity 2014
WebPagetest Power Users - Velocity 2014WebPagetest Power Users - Velocity 2014
WebPagetest Power Users - Velocity 2014
 
Velocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and you
 
Fail Well
Fail WellFail Well
Fail Well
 
Service workers
Service workersService workers
Service workers
 
Measuring performance - Velocity 2016 Training
Measuring performance - Velocity 2016 TrainingMeasuring performance - Velocity 2016 Training
Measuring performance - Velocity 2016 Training
 
Web Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsWeb Page Test - Beyond the Basics
Web Page Test - Beyond the Basics
 
Opticon 2015-Pushing the Boundaries of Optimizely
Opticon 2015-Pushing the Boundaries of OptimizelyOpticon 2015-Pushing the Boundaries of Optimizely
Opticon 2015-Pushing the Boundaries of Optimizely
 
Velocity Based Training
Velocity Based TrainingVelocity Based Training
Velocity Based Training
 
Debugging Distributed Systems - Velocity Santa Clara 2016
Debugging Distributed Systems - Velocity Santa Clara 2016Debugging Distributed Systems - Velocity Santa Clara 2016
Debugging Distributed Systems - Velocity Santa Clara 2016
 

Similar to TLS - 2016 Velocity Training

Http2 in practice
Http2 in practiceHttp2 in practice
Http2 in practice
Patrick Meenan
 
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure WebLinux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
All Things Open
 
Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)
Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)
Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)
Ontico
 
HTTPS @Scale
HTTPS @ScaleHTTPS @Scale
HTTPS @Scale
Arvind Mani
 
Service discovery like a pro (presented at reversimX)
Service discovery like a pro (presented at reversimX)Service discovery like a pro (presented at reversimX)
Service discovery like a pro (presented at reversimX)
Eran Harel
 
Primer to Browser Netwroking
Primer to Browser NetwrokingPrimer to Browser Netwroking
Primer to Browser Netwroking
Shuya Osaki
 
03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf
03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf
03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf
Jean-Frederic Clere
 
Http2
Http2Http2
Tomcat next
Tomcat nextTomcat next
Tomcat next
Jean-Frederic Clere
 
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атакСтек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Positive Hack Days
 
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, GoogleBringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Ambassador Labs
 
Otimizando servidores web
Otimizando servidores webOtimizando servidores web
Otimizando servidores web
Amazon Web Services LATAM
 
TCP Over Wireless
TCP Over WirelessTCP Over Wireless
TCP Over Wireless
Farooq Khan
 
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
Amazon Web Services
 
FPGA based 10G Performance Tester for HW OpenFlow Switch
FPGA based 10G Performance Tester for HW OpenFlow SwitchFPGA based 10G Performance Tester for HW OpenFlow Switch
FPGA based 10G Performance Tester for HW OpenFlow Switch
Yutaka Yasuda
 
Observability tips for HAProxy
Observability tips for HAProxyObservability tips for HAProxy
Observability tips for HAProxy
Willy Tarreau
 
Moving from HTTP to HTTPS
Moving from HTTP to HTTPSMoving from HTTP to HTTPS
Moving from HTTP to HTTPS
Blake Crosby
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Steffen Gebert
 
Introduction to performance tuning perl web applications
Introduction to performance tuning perl web applicationsIntroduction to performance tuning perl web applications
Introduction to performance tuning perl web applications
Perrin Harkins
 
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
BlueHat Security Conference
 

Similar to TLS - 2016 Velocity Training (20)

Http2 in practice
Http2 in practiceHttp2 in practice
Http2 in practice
 
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure WebLinux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
 
Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)
Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)
Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)
 
HTTPS @Scale
HTTPS @ScaleHTTPS @Scale
HTTPS @Scale
 
Service discovery like a pro (presented at reversimX)
Service discovery like a pro (presented at reversimX)Service discovery like a pro (presented at reversimX)
Service discovery like a pro (presented at reversimX)
 
Primer to Browser Netwroking
Primer to Browser NetwrokingPrimer to Browser Netwroking
Primer to Browser Netwroking
 
03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf
03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf
03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf
 
Http2
Http2Http2
Http2
 
Tomcat next
Tomcat nextTomcat next
Tomcat next
 
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атакСтек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
 
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, GoogleBringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
 
Otimizando servidores web
Otimizando servidores webOtimizando servidores web
Otimizando servidores web
 
TCP Over Wireless
TCP Over WirelessTCP Over Wireless
TCP Over Wireless
 
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
 
FPGA based 10G Performance Tester for HW OpenFlow Switch
FPGA based 10G Performance Tester for HW OpenFlow SwitchFPGA based 10G Performance Tester for HW OpenFlow Switch
FPGA based 10G Performance Tester for HW OpenFlow Switch
 
Observability tips for HAProxy
Observability tips for HAProxyObservability tips for HAProxy
Observability tips for HAProxy
 
Moving from HTTP to HTTPS
Moving from HTTP to HTTPSMoving from HTTP to HTTPS
Moving from HTTP to HTTPS
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
 
Introduction to performance tuning perl web applications
Introduction to performance tuning perl web applicationsIntroduction to performance tuning perl web applications
Introduction to performance tuning perl web applications
 
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
 

More from Patrick Meenan

Resource Prioritization
Resource PrioritizationResource Prioritization
Resource Prioritization
Patrick Meenan
 
HTTP/2 Prioritization
HTTP/2 PrioritizationHTTP/2 Prioritization
HTTP/2 Prioritization
Patrick Meenan
 
Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!
Patrick Meenan
 
How fast is it?
How fast is it?How fast is it?
How fast is it?
Patrick Meenan
 
Velocity 2014 nyc WebPagetest private instances
Velocity 2014 nyc   WebPagetest private instancesVelocity 2014 nyc   WebPagetest private instances
Velocity 2014 nyc WebPagetest private instances
Patrick Meenan
 
Mobile web performance - MoDev East
Mobile web performance - MoDev EastMobile web performance - MoDev East
Mobile web performance - MoDev East
Patrick Meenan
 
Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013
Patrick Meenan
 
Image optimization
Image optimizationImage optimization
Image optimization
Patrick Meenan
 
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Patrick Meenan
 
Velocity 2012 - Taming the Mobile Beast
Velocity 2012 - Taming the Mobile BeastVelocity 2012 - Taming the Mobile Beast
Velocity 2012 - Taming the Mobile Beast
Patrick Meenan
 
Measuring web performance
Measuring web performanceMeasuring web performance
Measuring web performance
Patrick Meenan
 
Frontend SPOF
Frontend SPOFFrontend SPOF
Frontend SPOF
Patrick Meenan
 
Web Performance Optimization
Web Performance OptimizationWeb Performance Optimization
Web Performance Optimization
Patrick Meenan
 
Web performance testing
Web performance testingWeb performance testing
Web performance testing
Patrick Meenan
 
Making the web faster
Making the web fasterMaking the web faster
Making the web faster
Patrick Meenan
 
Hands on performance testing and analysis with web pagetest
Hands on performance testing and analysis with web pagetestHands on performance testing and analysis with web pagetest
Hands on performance testing and analysis with web pagetest
Patrick Meenan
 

More from Patrick Meenan (16)

Resource Prioritization
Resource PrioritizationResource Prioritization
Resource Prioritization
 
HTTP/2 Prioritization
HTTP/2 PrioritizationHTTP/2 Prioritization
HTTP/2 Prioritization
 
Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!
 
How fast is it?
How fast is it?How fast is it?
How fast is it?
 
Velocity 2014 nyc WebPagetest private instances
Velocity 2014 nyc   WebPagetest private instancesVelocity 2014 nyc   WebPagetest private instances
Velocity 2014 nyc WebPagetest private instances
 
Mobile web performance - MoDev East
Mobile web performance - MoDev EastMobile web performance - MoDev East
Mobile web performance - MoDev East
 
Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013
 
Image optimization
Image optimizationImage optimization
Image optimization
 
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
 
Velocity 2012 - Taming the Mobile Beast
Velocity 2012 - Taming the Mobile BeastVelocity 2012 - Taming the Mobile Beast
Velocity 2012 - Taming the Mobile Beast
 
Measuring web performance
Measuring web performanceMeasuring web performance
Measuring web performance
 
Frontend SPOF
Frontend SPOFFrontend SPOF
Frontend SPOF
 
Web Performance Optimization
Web Performance OptimizationWeb Performance Optimization
Web Performance Optimization
 
Web performance testing
Web performance testingWeb performance testing
Web performance testing
 
Making the web faster
Making the web fasterMaking the web faster
Making the web faster
 
Hands on performance testing and analysis with web pagetest
Hands on performance testing and analysis with web pagetestHands on performance testing and analysis with web pagetest
Hands on performance testing and analysis with web pagetest
 

Recently uploaded

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 

Recently uploaded (20)

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 

TLS - 2016 Velocity Training

  • 1. DEBUGGING FRONT-END PERFORMANCE Tim Kadlec (@tkadlec) & Pat Meenan (@patmeenan) June 20-21, 2016 at Velocity Conference (#velocityconf)
  • 2. TLS
  • 8. • Service Workers • HTTP/2 • Geo Location • All new “powerful” web features • Chrome and Firefox REQUIRING HTTPS FOR…
  • 10.
  • 11. TLS handshake 101 Certificate verification (asymmetric crypto) Symmetric key negotiation encrypted app data 2 RTTs
  • 13. TLS resumption 101 Re-use negotiated parameters for the symmetric cipher ● Eliminates asymmetric crypto on the server via reuse of previously used parameters ● Eliminates full roundtrip, allowing 1-RTT connection establishment
  • 14. TLS resumption Session identifiers ● Server assigns session ID ● Server caches parameters ● Client sends session ID ● Session is “resumed” Session tickets ● Server encrypts parameters ● Server sets opaque ticket ● Client sends opaque ticket ● Server decrypts ticket and resumes session Shared state is on the server Shared state is on the client
  • 15. A few things to think about… 1. Session identifiers a. Require a shared cache between servers for best results b. Sessions must be expired and rotated in a secure manner 1. Session tickets a. Require a shared ticket encryption key b. Shared encryption key must be rotated in a secure manner 1. Perfect Forward Secrecy (PFS) “Session ticket keys have to be distributed to all the frontend machines, without being written to any kind of persistent storage, and frequently rotated.” https://www.imperialviolet.org/2011/11/22/forwardsecret.html
  • 16. CDNs are not just for static content. Edge termination can significantly reduce TCP and TLS handshake costs! Terminate TLS at the CDN edge... RTT with origin RTT with CDN edge *Before you hand over the keys to your kingdom, make your your CDN has their TLS stack optimized! You may be surprised...
  • 17. Online Certificate Status Protocol (OCSP) Stop the world and query the OCSP server ● DNS lookup ● TCP connect ● Wait for server response What if the OCSP check times out, gets blocked, etc? See “Revocation still doesn’t work.” Has this certificate been revoked?
  • 18. ● Chrome blocks on EV certs only ● Other browsers may block on all (FF) Eliminating OCSP latency OCSP endpoint Use OCSP stapling! 1. Server retrieves the OCSP response 2. Server “staples” response to certificate 3. Client verifies stapled response
  • 19. TLS handshake with stapled OCSP response... $> openssl s_client -connect example.com:443 -tls1 -tlsextdebug -status OCSP Response Data: OCSP Response Status: successful (0x0) Response Type: Basic OCSP Response Version: 1 (0x0) Responder Id: C = IL, O = StartCom Ltd., CN = StartCom Class 1 Server OCSP Signer Produced At: Feb 18 17:53:53 2014 GMT Responses: Certificate ID: Hash Algorithm: sha1 Issuer Name Hash: 6568874F40750F016A3475625E1F5C93E5A26D58 Issuer Key Hash: EB4234D098B0AB9FF41B6B08F7CC642EEF0E2C45 Serial Number: 0B60D5 Cert Status: good Stapled OCSP means no blocking! OCSP stapling increases certificate size! Is this a problem for your site? Better check.
  • 20. How many RTTs does your certificate incur? ● Average certificate chain depth: 2-3 certificates ● Average certificate size: ~1~1.5KB ● Plus OCSP response… ● Many cert chains overflow the old TCP (4 packet) CWND ● Upgrade your servers to use IW10! 3+ RTT TLS handshake due to 2 RTT cert?
  • 21. Check your server, you may be surprised... ● Capture a tcpdump of your handshake and check the exchange ● Some servers will pause on “large certificates” until they get an ACK for the first 4KB of the certificate (doh!) nginx <1.5.6, HAProxy <1.5-dev22 incur extra RTT, even w/ IW10!
  • 22. 1-RTT non-resumed handshake with TLS False Start Client sends application data immediately after “Finished”. ● Eliminates 1RTT ● No protocol changes... ● Only timing is affected In practice… ● Some servers break (ugh) ● Hence, opt-in behavior...
  • 23. Deploying False Start... ● Chrome and Firefox Chrome and Firefox ● ALPN advertisement - e.g. “http/1.1” ● Forward secrecy ciphersuite - e.g. ECDHE Safari ● Forward secrecy ciphersuite Internet Explorer ● Blacklist + timeout ● If handshake fails, retry without False Start TL;DR: enable ALPN advertisement and forward secrecy to get 1RTT handshakes.
  • 24. Ingredients for a 1-RTT TLS experience… 1. False Start = 1-RTT handshake for new visitors a. New users have to perform public-key crypto handshake 1. Session resumption = 1-RTT handshake for returning visitors a. Plus, we can skip public-key crypto by reusing previous parameters 1. OCSP Stapling a. No OCSP blocking to verify certificate status 1. False Start + Session Resumption + OCSP stapling a. 1-RTT handshake for new and returning visitors b. Returning visitors can skip the public-key crypto
  • 25. What’s wrong with this picture? 300ms RTT, 1.5Mbps... ● It’s a 2-RTT time to first byte! Large records are buffered, which delays processing! ● It’s a 2-RTT handshake… we know better! o At least there is no OSCP overhead!
  • 26. TLS record size + latency gotchas... This record is split across 8 TCP packets TLS allows up to 16KB of application per record ● New connection + 16KB record = CWND overflow and an extra RTT ● Lost or delayed packet delays processing of entire record
  • 27. Optimizing record size… 1. Google servers implement dynamic record sizing a. New connections start with 1400 byte records (aka, single MTU) b. After ~1MB is sent, switch to 16K records c. After ~1s of inactivity, reset to 1400 byte records 1. Most servers don’t optimize this case at all... a. HAProxy recently landed dynamic sizing patch - yay! b. Nginx landed ssl_buffer_size: static override - better, but meh... c. Cloudflare released patch for Nginx dynamic record sizing TL;DR: there is no “perfect record size”. Adjust dynamically.
  • 28. Quick sanity check... theory is great, but does this all work in practice?
  • 29. Tuning Nginx TLS Time To First Byte (TTTFB) ● Pre 1.5.7: bug for 4KB+ certs, resulting in 3RTT+ handshakes ● 1.7.1 added ssl_buffer_size: 4KB record size remove an RTT ● 1.7.1 with NPN and forward secrecy → 1RTT handshake https://www.igvita.com/2013/12/16/optimizing-nginx-tls-time-to-first-byte/
  • 34. • HTTP Response header Content-Security-Policy-Report-Only: default-src https:; report-uri http://reportcollector.example.com/collector.cgi CSP VIOLATION REPORTS
  • 35. • Server response header o Strict-Transport-Security: max-age=15768000; includeSubDomains; preload • Chrome/Firefox preload list STRICT TRANSPORT SECURITY - HSTS
  • 36. • Reducing/Reporting MITM attacks • Server response header o Public-Key-Pins: o report-uri=https://example.net/pkp-report • Doesn’t apply to “local trust anchors”  • Chrome, Firefox, Opera KEY PINNING - HPKP
  • 37. THANK YOU! Tim Kadlec (@tkadlec) & Pat Meenan (@patmeenan) June 20-21, 2016 at Velocity Conference (#velocityconf) Icons courtesy of The Noun Project