SlideShare a Scribd company logo
HTTP/2 in Examples
Agenda
• Who am I?
• What is the problem?
• HTTP/2
• Enabled websites
• Analyzing HTTP/2
• How do we know a site is using HTTP/2
• Chrome internals
• Tools to analyze HTTP/2
• How can we start using HTTP/2?
Who am I? @mihailstoynov
• Day job: sty.bz
• Java
• Security audits, web pen testing, sec tools
• Training, travelling,
• Hobby: jug.bg
• Java evangelism -> organizing events
• Java patches, writing manuals, early adoption
Greatest accomplishment so far
What is the problem?
• The CNN homepage has 157 resources:
• HTTP/1.0 – allows only one connection per request
• This means 157 connections have to be created
• HTTP/1.1 has keep-alive
• Allows reusing of connections, but it is serial
• If one request is slow, others wait
• Headers are repeated all the time
HTTP/2 history; streams and frames
• HTTP/2 began as SPDY
• Developed by Google and silently used
• Gmail, google.com, …
• Became a standard on February 17, 2015 (HTTP/1.1 was born 1997)
• HTTP/2 defines streams (bidirectional sequence of data)
• One TCP connection can have multiple streams
• Streams are not raw, they are typed
• The structure inside a stream is called a frame
• Frame types: HEADERS, DATA, SETTINGS, PUSH_PROMISE
• A request/response in http2 is HEADERS/DATA
HTTP/2 enabled websites
• twitter.com
• facebook.com
• technically not http/2
• spdy/3.1
• webtide.com
• And of course:
• jprime.io
• The only one supporting http/2 without encryption (h2c), yey
Analyzing HTTP2
How do we know a site is on HTTP/2?
• Browsers don't tell
• Developer tools are somewhat helpful
• Headers can be a hint
chrome://net-internals/#http2
How do we know a site is on HTTP/2?
• Browser plugins
• Yeah, you can install it right now and follow the demos
Tools to help analyze http2 traffic
• Burp Suite – NO
• ZAP – NO
• cURL – NO (you have to build it yourself, I tried and gave up)
• Wireshark
• Wireshark can't mitm ssl, can only read ssl with a private key
• Browsers support only strong crypto with http2
• Perfect Forward Secrecy
• https://en.wikipedia.org/wiki/Forward_secrecy
• Diffie-Hellman key exchange (DHE-RSA, DHE-DSS)
• Wireshark is useless in this scenario
How can I start using HTTP/2?
• https://github.com/http2/http2-spec/wiki/Implementations
• Java apps
• Tomcat – NO
• Undertow - Limited
• Jetty - extensive support
• Nginx just released 1.9.5 that supports http2
• Apache after 2.4.17
Main demo site
https://jprime.io
• Supports HTTP/2
• You can test it
• Real SSL certificate
• Supports protocol ids: h2
• Negotiation: ALPN, NPN, direct
• No upgrade supported
h2 vs h2c (protocol identifiers)
• h2 denotes HTTP/2 over TLS with ALPN for negotiation
• h2c denotes cleartext HTTP/2 with direct negotiation
• h2-14, h2c-14 – stands for draft 14
• h2-15, h2c-15 – stands for draft 15
• h2-16, h2c-16 – stands for draft 16
• h2-17, h2c-17 – stands for draft 17
• h2, h2c – the official spec impl
• SPDY/3.1: Google's first version of the HTTP/2 spec, formed the
basis of HTTP/2
ALPN
• Application-Layer Protocol Negotiation is a TLS extension for
protocol resolution
• This is how the servers/clients discover http2 (only for ssl)
• Example from Chrome (doesn't support h2c):
https://jprime.io:8443 (bad cypher)
• Supports HTTP/2
• You can test it
• Real SSL certificate
• Supports protocol ids: h2
• Negotiation: ALPN, NPN, direct
• No upgrade
• Bad cyphers in this example
• ssl_ciphers AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-
SHA:RC4-MD5;
TLS 1.2 Cypher Suites
• A deployment of HTTP/2 over TLS 1.2 SHOULD NOT use any of the
cipher suites that are listed in the cipher suite black list
• https://http2.github.io/http2-spec/#BadCipherSuites
http://jprime.io:81 (h2c)
• Try it – it fails
• The browsers refuse http/2 without ssl (h2c)
• Firefox shows garbage result
• Chrome downloads a binary file
The h2c client
• Jetty supports h2c and can act as a client
• we can write a small client app
• And sniff the data with wireshark
http2 with wireshark
Direct or Upgrade
• When no TLS, HTTP/2 is discovered:
• Upgrade header from client
• Server switches to http2 in the same connection (note the h2c)
Direct or Upgrade
• Direct (we "know" there is http2)
• Then we directly do the
HTTP/2 Connection Preface
• Final confirmation of the protocol
in use and to establish the initial
settings for the HTTP/2 connection
• The purpose of the connection preface is to stop http/1.1 servers
from sending data in case of error
A typical request/response
• Client: MAGIC (connection preface), SETTINGS
• Client: HEADERS http1: req.headers
• Server: SETTINGS, WINDOW_UPDATE
• Client: SETTINGS
• Server: HEADERS http1: res.headers
• Server: DATA http1: res.body
• Server: DATA
• Server: DATA
• Server: DATA
• Client: GOAWAY
Decrypting DATA
Jetty
• Jetty
• java -jar $JETTY_HOME/start.jar --add-to-startd=http,https,deploy
• java -jar $JETTY_HOME/start.jar --add-to-startd=http2,http2c
• java -jar $JETTY_HOME/start.jar
Q&A
Article and examples
WILL be available at
mihail.stoynov.com

More Related Content

PDF
[FFE19] Build a Flink AI Ecosystem
PDF
Declarative Clients in Spring
PDF
Spring Security e Spring Boot Aula - 2018
PPTX
REST and Microservices
PDF
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
PPTX
Apache Tez - A unifying Framework for Hadoop Data Processing
PDF
Celery - A Distributed Task Queue
PDF
Jenkins-CI
[FFE19] Build a Flink AI Ecosystem
Declarative Clients in Spring
Spring Security e Spring Boot Aula - 2018
REST and Microservices
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
Apache Tez - A unifying Framework for Hadoop Data Processing
Celery - A Distributed Task Queue
Jenkins-CI

What's hot (20)

PDF
Learn REST in 18 Slides
PDF
Understanding Reactive Programming
PPTX
Deep Dive into Apache Kafka
PDF
Building Event Driven (Micro)services with Apache Kafka
PDF
Secrets of Performance Tuning Java on Kubernetes
PPTX
Apache tomcat
PDF
Belajar Bahasa Arab untuk Pemula
PDF
Spring: Overview do framework mais popular para desenvolvimento em Java
PPT
Facebook Technology Stack
PDF
Kamailio - Load Balancing Load Balancers
PDF
Spring boot introduction
PDF
Technical tips for secure Apache Hadoop cluster #ApacheConAsia #ApacheCon
PDF
Spring Cloud Gateway
PDF
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
PDF
Nodejs - A performance que eu sempre quis ter
PDF
Bestyrelses CV Lars Kristiansen 20151116
PDF
Saga pattern and event sourcing with kafka
PDF
Super simple application security with Apache Shiro
PPT
Performance Testing With Loadrunner
PDF
Simplifying Distributed Transactions with Sagas in Kafka (Stephen Zoio, Simpl...
Learn REST in 18 Slides
Understanding Reactive Programming
Deep Dive into Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
Secrets of Performance Tuning Java on Kubernetes
Apache tomcat
Belajar Bahasa Arab untuk Pemula
Spring: Overview do framework mais popular para desenvolvimento em Java
Facebook Technology Stack
Kamailio - Load Balancing Load Balancers
Spring boot introduction
Technical tips for secure Apache Hadoop cluster #ApacheConAsia #ApacheCon
Spring Cloud Gateway
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Nodejs - A performance que eu sempre quis ter
Bestyrelses CV Lars Kristiansen 20151116
Saga pattern and event sourcing with kafka
Super simple application security with Apache Shiro
Performance Testing With Loadrunner
Simplifying Distributed Transactions with Sagas in Kafka (Stephen Zoio, Simpl...
Ad

Similar to HTTP/2 in Examples (20)

PDF
Trick or XFLTReaT a.k.a. Tunnel All The Things
PDF
XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)
PDF
XFLTReaT: A New Dimension In Tunnelling (DeepSec 2017)
PDF
XFLTReaT: A New Dimension in Tunnelling (HITB GSEC 2017)
PDF
SPDY and HTTP/2
PDF
Balázs Bucsay - XFLTReaT: Building a Tunnel
PDF
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
PDF
XFLTReat: a new dimension in tunnelling
PDF
When the internet bleeded : RootConf 2014
PPTX
Http2 Security Perspective
PDF
Burp suite
PDF
proxy2: HTTPS pins and needles
KEY
What's up with HTTP?
PDF
Hack Your Home Routers
PPTX
Steelcon 2015 - 0wning the internet of trash
PPTX
Maximizing Performance with SPDY and SSL
PPTX
What's New in HTTP/2
PDF
Are we security yet
PDF
ekb.py: KISS REST API
PDF
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
Trick or XFLTReaT a.k.a. Tunnel All The Things
XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)
XFLTReaT: A New Dimension In Tunnelling (DeepSec 2017)
XFLTReaT: A New Dimension in Tunnelling (HITB GSEC 2017)
SPDY and HTTP/2
Balázs Bucsay - XFLTReaT: Building a Tunnel
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
XFLTReat: a new dimension in tunnelling
When the internet bleeded : RootConf 2014
Http2 Security Perspective
Burp suite
proxy2: HTTPS pins and needles
What's up with HTTP?
Hack Your Home Routers
Steelcon 2015 - 0wning the internet of trash
Maximizing Performance with SPDY and SSL
What's New in HTTP/2
Are we security yet
ekb.py: KISS REST API
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
Ad

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Understanding Forklifts - TECH EHS Solution
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
top salesforce developer skills in 2025.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
AI in Product Development-omnex systems
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
Essential Infomation Tech presentation.pptx
PDF
Digital Strategies for Manufacturing Companies
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Odoo Companies in India – Driving Business Transformation.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Understanding Forklifts - TECH EHS Solution
wealthsignaloriginal-com-DS-text-... (1).pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
top salesforce developer skills in 2025.pdf
Reimagine Home Health with the Power of Agentic AI​
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Navsoft: AI-Powered Business Solutions & Custom Software Development
AI in Product Development-omnex systems
VVF-Customer-Presentation2025-Ver1.9.pptx
Design an Analysis of Algorithms I-SECS-1021-03
Odoo POS Development Services by CandidRoot Solutions
Essential Infomation Tech presentation.pptx
Digital Strategies for Manufacturing Companies
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Softaken Excel to vCard Converter Software.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41

HTTP/2 in Examples

  • 2. Agenda • Who am I? • What is the problem? • HTTP/2 • Enabled websites • Analyzing HTTP/2 • How do we know a site is using HTTP/2 • Chrome internals • Tools to analyze HTTP/2 • How can we start using HTTP/2?
  • 3. Who am I? @mihailstoynov • Day job: sty.bz • Java • Security audits, web pen testing, sec tools • Training, travelling, • Hobby: jug.bg • Java evangelism -> organizing events • Java patches, writing manuals, early adoption
  • 5. What is the problem? • The CNN homepage has 157 resources: • HTTP/1.0 – allows only one connection per request • This means 157 connections have to be created • HTTP/1.1 has keep-alive • Allows reusing of connections, but it is serial • If one request is slow, others wait • Headers are repeated all the time
  • 6. HTTP/2 history; streams and frames • HTTP/2 began as SPDY • Developed by Google and silently used • Gmail, google.com, … • Became a standard on February 17, 2015 (HTTP/1.1 was born 1997) • HTTP/2 defines streams (bidirectional sequence of data) • One TCP connection can have multiple streams • Streams are not raw, they are typed • The structure inside a stream is called a frame • Frame types: HEADERS, DATA, SETTINGS, PUSH_PROMISE • A request/response in http2 is HEADERS/DATA
  • 7. HTTP/2 enabled websites • twitter.com • facebook.com • technically not http/2 • spdy/3.1 • webtide.com • And of course: • jprime.io • The only one supporting http/2 without encryption (h2c), yey
  • 9. How do we know a site is on HTTP/2? • Browsers don't tell • Developer tools are somewhat helpful • Headers can be a hint
  • 11. How do we know a site is on HTTP/2? • Browser plugins • Yeah, you can install it right now and follow the demos
  • 12. Tools to help analyze http2 traffic • Burp Suite – NO • ZAP – NO • cURL – NO (you have to build it yourself, I tried and gave up) • Wireshark • Wireshark can't mitm ssl, can only read ssl with a private key • Browsers support only strong crypto with http2 • Perfect Forward Secrecy • https://en.wikipedia.org/wiki/Forward_secrecy • Diffie-Hellman key exchange (DHE-RSA, DHE-DSS) • Wireshark is useless in this scenario
  • 13. How can I start using HTTP/2? • https://github.com/http2/http2-spec/wiki/Implementations • Java apps • Tomcat – NO • Undertow - Limited • Jetty - extensive support • Nginx just released 1.9.5 that supports http2 • Apache after 2.4.17
  • 15. https://jprime.io • Supports HTTP/2 • You can test it • Real SSL certificate • Supports protocol ids: h2 • Negotiation: ALPN, NPN, direct • No upgrade supported
  • 16. h2 vs h2c (protocol identifiers) • h2 denotes HTTP/2 over TLS with ALPN for negotiation • h2c denotes cleartext HTTP/2 with direct negotiation • h2-14, h2c-14 – stands for draft 14 • h2-15, h2c-15 – stands for draft 15 • h2-16, h2c-16 – stands for draft 16 • h2-17, h2c-17 – stands for draft 17 • h2, h2c – the official spec impl • SPDY/3.1: Google's first version of the HTTP/2 spec, formed the basis of HTTP/2
  • 17. ALPN • Application-Layer Protocol Negotiation is a TLS extension for protocol resolution • This is how the servers/clients discover http2 (only for ssl) • Example from Chrome (doesn't support h2c):
  • 18. https://jprime.io:8443 (bad cypher) • Supports HTTP/2 • You can test it • Real SSL certificate • Supports protocol ids: h2 • Negotiation: ALPN, NPN, direct • No upgrade • Bad cyphers in this example • ssl_ciphers AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3- SHA:RC4-MD5;
  • 19. TLS 1.2 Cypher Suites • A deployment of HTTP/2 over TLS 1.2 SHOULD NOT use any of the cipher suites that are listed in the cipher suite black list • https://http2.github.io/http2-spec/#BadCipherSuites
  • 20. http://jprime.io:81 (h2c) • Try it – it fails • The browsers refuse http/2 without ssl (h2c) • Firefox shows garbage result • Chrome downloads a binary file
  • 21. The h2c client • Jetty supports h2c and can act as a client • we can write a small client app • And sniff the data with wireshark
  • 23. Direct or Upgrade • When no TLS, HTTP/2 is discovered: • Upgrade header from client • Server switches to http2 in the same connection (note the h2c)
  • 24. Direct or Upgrade • Direct (we "know" there is http2) • Then we directly do the HTTP/2 Connection Preface • Final confirmation of the protocol in use and to establish the initial settings for the HTTP/2 connection • The purpose of the connection preface is to stop http/1.1 servers from sending data in case of error
  • 25. A typical request/response • Client: MAGIC (connection preface), SETTINGS • Client: HEADERS http1: req.headers • Server: SETTINGS, WINDOW_UPDATE • Client: SETTINGS • Server: HEADERS http1: res.headers • Server: DATA http1: res.body • Server: DATA • Server: DATA • Server: DATA • Client: GOAWAY
  • 27. Jetty • Jetty • java -jar $JETTY_HOME/start.jar --add-to-startd=http,https,deploy • java -jar $JETTY_HOME/start.jar --add-to-startd=http2,http2c • java -jar $JETTY_HOME/start.jar
  • 28. Q&A Article and examples WILL be available at mihail.stoynov.com