SlideShare a Scribd company logo
SSL/TLS and HTTP/2 State of theSSL/TLS and HTTP/2 State of the
ArtArt in Our Serversin Our Servers
Jean-Frederic ClereJean-Frederic Clere
What I will coverWhat I will cover
●
HTTP/2
●
HTTP/2 and ALPN
●
Servers
●
Apache HTTPD
●
Tomcat
●
Traffic server
●
Demos
●
Questions?
11/18/16 2
Who I amWho I am
Jean-Frederic Clere
Red Hat
Years writing JAVA code and server software
Tomcat committer since 2001
Doing OpenSource since 1999
Cyclist/Runner etc
Lived 15 years in Spain (Barcelona)
Now in Neuchâtel (CH)11/18/16 3
Why HTTP/2Why HTTP/2
– HTTP/1.1: June 1999 (RFC 2616)
●
1999:
– 1 page ~ 1kB HTML
●
2015:
– 1 page ~ 3MB HTML + IMAGES + JS + CSS etc
– Protocol:
●
Not adapted / inefficient / etc
11/18/16 4
HTTP/2 generalHTTP/2 general
●
HTTP/2:
– Binary
– Frame
– Multiplex
– Based on SPDY
– TLS everywhere:
●
Browers use https and strong ciphers
– No forward proxy
– h2c: Clear text only with reverse proxy (proxy to back-end server)
requires upgrade.
11/18/16 5
HTTP/2 generalHTTP/2 general
●
Two specifications:
– Hypertext Transfer Protocol version 2 - RFC7540
– HPACK - Header Compression for HTTP/2 - RFC7541
●
By the Internet Engineering Task Force
●
ALPN Application-Layer Protocol Negotiation - RFC 7301
11/18/16 6
HTTP/2 MultiplexedHTTP/2 Multiplexed
11/18/16 7
Headers
Data
Headers
Headers
Headers Data Data
Headers Data Data
HeadersData
Headers
HTTP/2 : moreHTTP/2 : more
● HTTP headers compression
– ~ 80 % save
● Request priority
– Both sides
● Server Push
– Prevent round trip to get element of a page
– Faster / better rendering on browsers.
11/18/16 8
HTTP/2 When BrowsersHTTP/2 When Browsers
● Browser with HTTP/2 and TLS
– FireFox 34
– Chrome 40 (with ALPN before was NPN)
– IE 11
– Opera and Safari 9
● Stats from docs.trafficserver and ci.trafficserver:
– 80% is over HTTP/2 (data from 23th of September)
● → go for it now!
11/18/16 9
ALPN Client Hello (Firefox)ALPN Client Hello (Firefox)
11/18/16 10
ALPN Server Hello (tomcat)ALPN Server Hello (tomcat)
11/18/16 11
RequirementsRequirements
● OpenSSL for our 3 servers
– At least 1.0.2c
● Tomcat (8.5 / trunk)
– Tomcat-native (1.2.6 / trunk)
● Httpd (2.4.17 / trunk)
– HTTP/2 C Library (libnghttp2)
● TrafficServer (since ATS v5.3.2).
– Nothing except openssl.11/18/16 12
StatusStatus
● Tomcat (trunk/8.5)
– Full support / released as stable.
– Needs servlet 4.0 (JSR 369) for server PUSH API
– Can't be full JAVA until JDK9 (ALPN support)
● Httpd (available since 2.4.17)
– Full support (since 2.4.20)
● TrafficServer (since 5.3.0) (flow control 6.1)
– Missing Priorities (6.2?) and Server PUSH (later)
11/18/16 13
TC connector server.xmlTC connector server.xml
<Connector
port="8002"
scheme="https"
SSLEnabled="true"
ciphers="TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
SSLCertificateFile="/home/jfclere/CERTS/newcert.pem"
SSLCertificateKeyFile="/home/jfclere/CERTS/newkey.txt.pem"
protocol="org.apache.coyote.http11.Http11AprProtocol">
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<Connector/>
<Connector port="8003" protocol="HTTP/1.1"
SSLEnabled="true" scheme="https" secure="true"
keystoreFile="conf/.keystore" keystorePass="changeit"
socket.directBuffer="true" socket.directSslBuffer="true">
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
</Connector>
Tomcat / configurationTomcat / configuration
In bin/setenv.sh:
LD_LIBRARY_PATH=/home/jfclere/tomcat-native/native/.libs
export LD_LIBRARY_PATH
And the libtcnative-1.so linked with openssl-1.0.2c, checking with ldd:
libssl.so.1.0.0 => /home/jfclere/OPENSSL-1.0.2c/lib/libssl.so.1.0.0 (0x00007f6ab147b000)
libcrypto.so.1.0.0 => /home/jfclere/OPENSSL-1.0.2c/lib/libcrypto.so.1.0.0 (0x00007f6ab1028000)
libapr-1.so.0 => /home/jfclere/APR-1.4.x/lib/libapr-1.so.0 (0x00007f6ab0dfa000)
Usually the openssl of recent distribution (fedora 23) will work.
11/18/16 15
Tomcat / PerformancesTomcat / Performances
11/18/16 16
4KiB.bin
8KiB.bin
16KiB.bin
32KiB.bin
64KiB.bin
128KiB.bin
256KiB.bin
512KiB.bin
1MiB.bin
0
50000
100000
150000
200000
250000
300000
350000
400000
Concurency 240
coyote_nio_jsse_h1_https
coyote_nio_jsse_h2_https
File Size
Kbytes/second
Tomcat / PerformancesTomcat / Performances
11/18/16 17
4KiB
8KiB
16KiB
32KiB
64KiB
128KiB
256KiB
512KiB
1MiB
0
10
20
30
40
50
60
70
80
90
Concurency 240
coyote_nio_jsse_h1_https
coyote_nio_jsse_h2_https
File Size
CPUUsage
Tomcat / DemoTomcat / Demo
● No server push (may be change it: SimpleImagePush)
● Multiplexing
● headers compression
● Page html page:
– That requires a lot (~1000) of (~4Kbytes) images to render.
11/18/16 18
TrafficServer / ConfigurationTrafficServer / Configuration
● records.config
– CONFIG proxy.config.ssl.number.threads INT 0
– CONFIG proxy.config.http.server_ports STRING 8888:ssl
– CONFIG proxy.config.url_remap.pristine_host_hdr INT 1
– CONFIG proxy.config.http2.enabled INT 1
– CONFIG proxy.config.ssl.TLSv1_1 INT 1
– CONFIG proxy.config.ssl.TLSv1_2 INT 1
● ssl_multicert.config:
– dest_ip=* ssl_cert_name=newcert.pem ssl_key_name=newkey.txt.pem
● remap.config:
– map / http://127.0.0.1:8080
● ip_allow.config:
– src_ip=192.168.1.38 action=ip_allow method=ALL
– src_ip=::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff action=ip_allow method=ALL
11/18/16 19
TrafficServer / DemoTrafficServer / Demo
● Like tomcat one
● Uses http/1.1 tomcat nio connector on 8080
as back-end.
11/18/16 20
HTTPd / ConfigurationHTTPd / Configuration
● httpd.conf:
LoadModule h2_module modules/mod_h2.so
Listen 8006
<VirtualHost *:8006>
Protocols h2 http/1.1
ProtocolsHonorOrder on
SSLEngine on
SSLCertificateFile "/home/jfclere/CERTS/newcert.pem"
SSLCertificateKeyFile "/home/jfclere/CERTS/newkey.pem"
SSLCACertificateFile "/etc/pki/CA/cacert.pem"
</VirtualHost>
11/18/16 21
HTTPd / PerformancesHTTPd / Performances
11/18/16 22
4KiB.bin
8KiB.bin
16KiB.bin
32KiB.bin
64KiB.bin
128KiB.bin
256KiB.bin
512KiB.bin
1MiB.bin
0
50000
100000
150000
200000
250000
300000
350000
400000
Concurency 240
httpd_h1_https
httpd_h2_https
File Size
KBytes/second
HTTPd / PerformancesHTTPd / Performances
11/18/16 23
4KiB 8KiB 16KiB 32KiB 64KiB 128KiB 256KiB 512KiB 1MiB
0
10
20
30
40
50
60
70
80
Concurency 240
httpd_h1_https
httpd_h2_https
File Szie
CPUusage
HTTPd / Configuration proxyHTTPd / Configuration proxy
● httpd.conf:
LoadModule h2_module modules/mod_h2.so
LoadModule proxy_http2_module modules/mod_proxy_http2.so
Listen 8006
<VirtualHost *:8006>
Protocols h2 http/1.1
ProtocolsHonorOrder on
SSLEngine on
…
ProxyPass "/" "h2c://localhost:8003/"
</VirtualHost>
11/18/16 24
HTTPd / DemoHTTPd / Demo
● Like the tomcat one:
– htdocs/http2.html
– htdocs/images/ the images.
11/18/16 25
HTTP/2 ready?HTTP/2 ready?
● Conclusion:
– Using HTTP/2 without PUSH is already good.
– “safer” crypto is good but expensive.
– No need to rewrite application to get the gains.
GO FOR IT
11/18/16 26
Questions?Questions?
Thank you!Thank you!
● jfclere@gmail.com
● users@tomcat.apache.org
● users@httpd.apache.org
● users@trafficserver.apache.org
● https://http2.github.io/
● Demo generator:
– https://github.com/jfclere/h2_demos
11/18/16 27
Jean-Frederic Clere
@jfclere
jfclere@gmail.com

More Related Content

What's hot

Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linaro
 

What's hot (20)

Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Irc how to sept 2012
Irc how to   sept 2012Irc how to   sept 2012
Irc how to sept 2012
 
Http2 on go1.6rc2
Http2 on go1.6rc2Http2 on go1.6rc2
Http2 on go1.6rc2
 
Ostinato FOSS.IN 2010
Ostinato FOSS.IN 2010Ostinato FOSS.IN 2010
Ostinato FOSS.IN 2010
 
Offloading TC Rules on OVS Internal Ports
Offloading TC Rules on OVS Internal Ports Offloading TC Rules on OVS Internal Ports
Offloading TC Rules on OVS Internal Ports
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch
 
Dpdk accelerated Ostinato
Dpdk accelerated OstinatoDpdk accelerated Ostinato
Dpdk accelerated Ostinato
 
Ethernet Shield
Ethernet ShieldEthernet Shield
Ethernet Shield
 
Networking and Go: An Epic Journey
Networking and Go: An Epic JourneyNetworking and Go: An Epic Journey
Networking and Go: An Epic Journey
 
TRex Realistic Traffic Generator - Stateless support
TRex  Realistic Traffic Generator  - Stateless support TRex  Realistic Traffic Generator  - Stateless support
TRex Realistic Traffic Generator - Stateless support
 
Deploy your own P2P network
Deploy your own P2P networkDeploy your own P2P network
Deploy your own P2P network
 
Primer to Browser Netwroking
Primer to Browser NetwrokingPrimer to Browser Netwroking
Primer to Browser Netwroking
 
Ostinato - Craft Packets, Generate Traffic [SharkFest '20]
Ostinato - Craft Packets, Generate Traffic [SharkFest '20]Ostinato - Craft Packets, Generate Traffic [SharkFest '20]
Ostinato - Craft Packets, Generate Traffic [SharkFest '20]
 
Multihomed Linux router
Multihomed Linux routerMultihomed Linux router
Multihomed Linux router
 
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
 
Load balancing with Linux
Load balancing with LinuxLoad balancing with Linux
Load balancing with Linux
 
Extensible web #html5j
Extensible web #html5jExtensible web #html5j
Extensible web #html5j
 
Extensible web
Extensible webExtensible web
Extensible web
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
 
[POSS 2019] OVirt and Ceph: Perfect Combination.?
[POSS 2019] OVirt and  Ceph: Perfect Combination.?[POSS 2019] OVirt and  Ceph: Perfect Combination.?
[POSS 2019] OVirt and Ceph: Perfect Combination.?
 

Viewers also liked

Crm in health care
Crm in health careCrm in health care
Crm in health care
Manoj Kumar
 

Viewers also liked (8)

CRM- Need of Industry
CRM- Need of IndustryCRM- Need of Industry
CRM- Need of Industry
 
Connecting CRM And Your Healthcare Website
Connecting CRM And Your Healthcare WebsiteConnecting CRM And Your Healthcare Website
Connecting CRM And Your Healthcare Website
 
Health System CRM the Vision of 1-to-1 Marketing in Healthcare
Health System CRM the Vision of 1-to-1 Marketing in HealthcareHealth System CRM the Vision of 1-to-1 Marketing in Healthcare
Health System CRM the Vision of 1-to-1 Marketing in Healthcare
 
Crm in health care
Crm in health careCrm in health care
Crm in health care
 
Slide shere
Slide shereSlide shere
Slide shere
 
2014 Online Marketing Trends
2014 Online Marketing Trends2014 Online Marketing Trends
2014 Online Marketing Trends
 
Digital Marketing PPT
Digital Marketing PPTDigital Marketing PPT
Digital Marketing PPT
 
Digital Marketing Overview
Digital Marketing OverviewDigital Marketing Overview
Digital Marketing Overview
 

Similar to HTTP/2 and SSL/TLS state of art in ASF servers

Similar to HTTP/2 and SSL/TLS state of art in ASF servers (20)

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
 
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our ServersHTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
 
Tomcat next
Tomcat nextTomcat next
Tomcat next
 
Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)
Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)
Linux kernel TLS и HTTPS / Александр Крижановский (Tempesta Technologies)
 
Tomcat openssl
Tomcat opensslTomcat openssl
Tomcat openssl
 
Apache httpd reverse proxy and Tomcat
Apache httpd reverse proxy and TomcatApache httpd reverse proxy and Tomcat
Apache httpd reverse proxy and Tomcat
 
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
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
 
Http/2 lightning
Http/2   lightningHttp/2   lightning
Http/2 lightning
 
Network Automation with Salt and NAPALM: a self-resilient network
Network Automation with Salt and NAPALM: a self-resilient networkNetwork Automation with Salt and NAPALM: a self-resilient network
Network Automation with Salt and NAPALM: a self-resilient network
 
Varnish SSL / TLS
Varnish SSL / TLSVarnish SSL / TLS
Varnish SSL / TLS
 
Tomcat openssl
Tomcat opensslTomcat openssl
Tomcat openssl
 
Socket programming, and openresty
Socket programming, and openrestySocket programming, and openresty
Socket programming, and openresty
 
Ltsp talk
Ltsp talkLtsp talk
Ltsp talk
 
TLS - 2016 Velocity Training
TLS - 2016 Velocity TrainingTLS - 2016 Velocity Training
TLS - 2016 Velocity Training
 
Tomcat from a cluster to the cloud on RP3
Tomcat from a cluster to the cloud on RP3Tomcat from a cluster to the cloud on RP3
Tomcat from a cluster to the cloud on RP3
 
Haproxy - zastosowania
Haproxy - zastosowaniaHaproxy - zastosowania
Haproxy - zastosowania
 
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
 
Monkey Server
Monkey ServerMonkey Server
Monkey Server
 
Having fun with Raspberry(s) and Apache projects
Having fun with Raspberry(s) and Apache projectsHaving fun with Raspberry(s) and Apache projects
Having fun with Raspberry(s) and Apache projects
 

More from Jean-Frederic Clere

More from Jean-Frederic Clere (10)

Panama.pdf
Panama.pdfPanama.pdf
Panama.pdf
 
03_clere_Proxing to tomcat with httpd.pdf
03_clere_Proxing to tomcat with httpd.pdf03_clere_Proxing to tomcat with httpd.pdf
03_clere_Proxing to tomcat with httpd.pdf
 
01_clere_Having fun with a solar panel, camera and raspberry. How with a few ...
01_clere_Having fun with a solar panel, camera and raspberry. How with a few ...01_clere_Having fun with a solar panel, camera and raspberry. How with a few ...
01_clere_Having fun with a solar panel, camera and raspberry. How with a few ...
 
Cloud RPI4 tomcat ARM64
Cloud RPI4 tomcat ARM64Cloud RPI4 tomcat ARM64
Cloud RPI4 tomcat ARM64
 
From a cluster to the Cloud
From a cluster to the CloudFrom a cluster to the Cloud
From a cluster to the Cloud
 
Apache httpd and TLS/SSL certificates validation
Apache httpd and TLS/SSL certificates validationApache httpd and TLS/SSL certificates validation
Apache httpd and TLS/SSL certificates validation
 
Juggva cloud
Juggva cloudJuggva cloud
Juggva cloud
 
TomcatCon: from a cluster to the cloud
TomcatCon: from a cluster to the cloudTomcatCon: from a cluster to the cloud
TomcatCon: from a cluster to the cloud
 
Having fun with Raspberry and Apache projects
Having fun with Raspberry and Apache projectsHaving fun with Raspberry and Apache projects
Having fun with Raspberry and Apache projects
 
Native 1.2.8
Native 1.2.8Native 1.2.8
Native 1.2.8
 

Recently uploaded

527598851-ppc-due-to-various-govt-policies.pdf
527598851-ppc-due-to-various-govt-policies.pdf527598851-ppc-due-to-various-govt-policies.pdf
527598851-ppc-due-to-various-govt-policies.pdf
rajpreetkaur75080
 

Recently uploaded (14)

05232024 Joint Meeting - Community Networking
05232024 Joint Meeting - Community Networking05232024 Joint Meeting - Community Networking
05232024 Joint Meeting - Community Networking
 
Eureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 PresentationEureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 Presentation
 
Pollinator Ambassador Earth Steward Day Presentation 2024-05-22
Pollinator Ambassador Earth Steward Day Presentation 2024-05-22Pollinator Ambassador Earth Steward Day Presentation 2024-05-22
Pollinator Ambassador Earth Steward Day Presentation 2024-05-22
 
Hi-Tech Industry 2024-25 Prospective.pptx
Hi-Tech Industry 2024-25 Prospective.pptxHi-Tech Industry 2024-25 Prospective.pptx
Hi-Tech Industry 2024-25 Prospective.pptx
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
 
The Canoga Gardens Development Project. PDF
The Canoga Gardens Development Project. PDFThe Canoga Gardens Development Project. PDF
The Canoga Gardens Development Project. PDF
 
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
 
123445566544333222333444dxcvbcvcvharsh.pptx
123445566544333222333444dxcvbcvcvharsh.pptx123445566544333222333444dxcvbcvcvharsh.pptx
123445566544333222333444dxcvbcvcvharsh.pptx
 
Writing Sample 2 -Bridging the Divide: Enhancing Public Engagement in Urban D...
Writing Sample 2 -Bridging the Divide: Enhancing Public Engagement in Urban D...Writing Sample 2 -Bridging the Divide: Enhancing Public Engagement in Urban D...
Writing Sample 2 -Bridging the Divide: Enhancing Public Engagement in Urban D...
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
 
Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
 
527598851-ppc-due-to-various-govt-policies.pdf
527598851-ppc-due-to-various-govt-policies.pdf527598851-ppc-due-to-various-govt-policies.pdf
527598851-ppc-due-to-various-govt-policies.pdf
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
 

HTTP/2 and SSL/TLS state of art in ASF servers

  • 1. SSL/TLS and HTTP/2 State of theSSL/TLS and HTTP/2 State of the ArtArt in Our Serversin Our Servers Jean-Frederic ClereJean-Frederic Clere
  • 2. What I will coverWhat I will cover ● HTTP/2 ● HTTP/2 and ALPN ● Servers ● Apache HTTPD ● Tomcat ● Traffic server ● Demos ● Questions? 11/18/16 2
  • 3. Who I amWho I am Jean-Frederic Clere Red Hat Years writing JAVA code and server software Tomcat committer since 2001 Doing OpenSource since 1999 Cyclist/Runner etc Lived 15 years in Spain (Barcelona) Now in Neuchâtel (CH)11/18/16 3
  • 4. Why HTTP/2Why HTTP/2 – HTTP/1.1: June 1999 (RFC 2616) ● 1999: – 1 page ~ 1kB HTML ● 2015: – 1 page ~ 3MB HTML + IMAGES + JS + CSS etc – Protocol: ● Not adapted / inefficient / etc 11/18/16 4
  • 5. HTTP/2 generalHTTP/2 general ● HTTP/2: – Binary – Frame – Multiplex – Based on SPDY – TLS everywhere: ● Browers use https and strong ciphers – No forward proxy – h2c: Clear text only with reverse proxy (proxy to back-end server) requires upgrade. 11/18/16 5
  • 6. HTTP/2 generalHTTP/2 general ● Two specifications: – Hypertext Transfer Protocol version 2 - RFC7540 – HPACK - Header Compression for HTTP/2 - RFC7541 ● By the Internet Engineering Task Force ● ALPN Application-Layer Protocol Negotiation - RFC 7301 11/18/16 6
  • 7. HTTP/2 MultiplexedHTTP/2 Multiplexed 11/18/16 7 Headers Data Headers Headers Headers Data Data Headers Data Data HeadersData Headers
  • 8. HTTP/2 : moreHTTP/2 : more ● HTTP headers compression – ~ 80 % save ● Request priority – Both sides ● Server Push – Prevent round trip to get element of a page – Faster / better rendering on browsers. 11/18/16 8
  • 9. HTTP/2 When BrowsersHTTP/2 When Browsers ● Browser with HTTP/2 and TLS – FireFox 34 – Chrome 40 (with ALPN before was NPN) – IE 11 – Opera and Safari 9 ● Stats from docs.trafficserver and ci.trafficserver: – 80% is over HTTP/2 (data from 23th of September) ● → go for it now! 11/18/16 9
  • 10. ALPN Client Hello (Firefox)ALPN Client Hello (Firefox) 11/18/16 10
  • 11. ALPN Server Hello (tomcat)ALPN Server Hello (tomcat) 11/18/16 11
  • 12. RequirementsRequirements ● OpenSSL for our 3 servers – At least 1.0.2c ● Tomcat (8.5 / trunk) – Tomcat-native (1.2.6 / trunk) ● Httpd (2.4.17 / trunk) – HTTP/2 C Library (libnghttp2) ● TrafficServer (since ATS v5.3.2). – Nothing except openssl.11/18/16 12
  • 13. StatusStatus ● Tomcat (trunk/8.5) – Full support / released as stable. – Needs servlet 4.0 (JSR 369) for server PUSH API – Can't be full JAVA until JDK9 (ALPN support) ● Httpd (available since 2.4.17) – Full support (since 2.4.20) ● TrafficServer (since 5.3.0) (flow control 6.1) – Missing Priorities (6.2?) and Server PUSH (later) 11/18/16 13
  • 14. TC connector server.xmlTC connector server.xml <Connector port="8002" scheme="https" SSLEnabled="true" ciphers="TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" SSLCertificateFile="/home/jfclere/CERTS/newcert.pem" SSLCertificateKeyFile="/home/jfclere/CERTS/newkey.txt.pem" protocol="org.apache.coyote.http11.Http11AprProtocol"> <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> <Connector/> <Connector port="8003" protocol="HTTP/1.1" SSLEnabled="true" scheme="https" secure="true" keystoreFile="conf/.keystore" keystorePass="changeit" socket.directBuffer="true" socket.directSslBuffer="true"> <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> </Connector>
  • 15. Tomcat / configurationTomcat / configuration In bin/setenv.sh: LD_LIBRARY_PATH=/home/jfclere/tomcat-native/native/.libs export LD_LIBRARY_PATH And the libtcnative-1.so linked with openssl-1.0.2c, checking with ldd: libssl.so.1.0.0 => /home/jfclere/OPENSSL-1.0.2c/lib/libssl.so.1.0.0 (0x00007f6ab147b000) libcrypto.so.1.0.0 => /home/jfclere/OPENSSL-1.0.2c/lib/libcrypto.so.1.0.0 (0x00007f6ab1028000) libapr-1.so.0 => /home/jfclere/APR-1.4.x/lib/libapr-1.so.0 (0x00007f6ab0dfa000) Usually the openssl of recent distribution (fedora 23) will work. 11/18/16 15
  • 16. Tomcat / PerformancesTomcat / Performances 11/18/16 16 4KiB.bin 8KiB.bin 16KiB.bin 32KiB.bin 64KiB.bin 128KiB.bin 256KiB.bin 512KiB.bin 1MiB.bin 0 50000 100000 150000 200000 250000 300000 350000 400000 Concurency 240 coyote_nio_jsse_h1_https coyote_nio_jsse_h2_https File Size Kbytes/second
  • 17. Tomcat / PerformancesTomcat / Performances 11/18/16 17 4KiB 8KiB 16KiB 32KiB 64KiB 128KiB 256KiB 512KiB 1MiB 0 10 20 30 40 50 60 70 80 90 Concurency 240 coyote_nio_jsse_h1_https coyote_nio_jsse_h2_https File Size CPUUsage
  • 18. Tomcat / DemoTomcat / Demo ● No server push (may be change it: SimpleImagePush) ● Multiplexing ● headers compression ● Page html page: – That requires a lot (~1000) of (~4Kbytes) images to render. 11/18/16 18
  • 19. TrafficServer / ConfigurationTrafficServer / Configuration ● records.config – CONFIG proxy.config.ssl.number.threads INT 0 – CONFIG proxy.config.http.server_ports STRING 8888:ssl – CONFIG proxy.config.url_remap.pristine_host_hdr INT 1 – CONFIG proxy.config.http2.enabled INT 1 – CONFIG proxy.config.ssl.TLSv1_1 INT 1 – CONFIG proxy.config.ssl.TLSv1_2 INT 1 ● ssl_multicert.config: – dest_ip=* ssl_cert_name=newcert.pem ssl_key_name=newkey.txt.pem ● remap.config: – map / http://127.0.0.1:8080 ● ip_allow.config: – src_ip=192.168.1.38 action=ip_allow method=ALL – src_ip=::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff action=ip_allow method=ALL 11/18/16 19
  • 20. TrafficServer / DemoTrafficServer / Demo ● Like tomcat one ● Uses http/1.1 tomcat nio connector on 8080 as back-end. 11/18/16 20
  • 21. HTTPd / ConfigurationHTTPd / Configuration ● httpd.conf: LoadModule h2_module modules/mod_h2.so Listen 8006 <VirtualHost *:8006> Protocols h2 http/1.1 ProtocolsHonorOrder on SSLEngine on SSLCertificateFile "/home/jfclere/CERTS/newcert.pem" SSLCertificateKeyFile "/home/jfclere/CERTS/newkey.pem" SSLCACertificateFile "/etc/pki/CA/cacert.pem" </VirtualHost> 11/18/16 21
  • 22. HTTPd / PerformancesHTTPd / Performances 11/18/16 22 4KiB.bin 8KiB.bin 16KiB.bin 32KiB.bin 64KiB.bin 128KiB.bin 256KiB.bin 512KiB.bin 1MiB.bin 0 50000 100000 150000 200000 250000 300000 350000 400000 Concurency 240 httpd_h1_https httpd_h2_https File Size KBytes/second
  • 23. HTTPd / PerformancesHTTPd / Performances 11/18/16 23 4KiB 8KiB 16KiB 32KiB 64KiB 128KiB 256KiB 512KiB 1MiB 0 10 20 30 40 50 60 70 80 Concurency 240 httpd_h1_https httpd_h2_https File Szie CPUusage
  • 24. HTTPd / Configuration proxyHTTPd / Configuration proxy ● httpd.conf: LoadModule h2_module modules/mod_h2.so LoadModule proxy_http2_module modules/mod_proxy_http2.so Listen 8006 <VirtualHost *:8006> Protocols h2 http/1.1 ProtocolsHonorOrder on SSLEngine on … ProxyPass "/" "h2c://localhost:8003/" </VirtualHost> 11/18/16 24
  • 25. HTTPd / DemoHTTPd / Demo ● Like the tomcat one: – htdocs/http2.html – htdocs/images/ the images. 11/18/16 25
  • 26. HTTP/2 ready?HTTP/2 ready? ● Conclusion: – Using HTTP/2 without PUSH is already good. – “safer” crypto is good but expensive. – No need to rewrite application to get the gains. GO FOR IT 11/18/16 26
  • 27. Questions?Questions? Thank you!Thank you! ● jfclere@gmail.com ● users@tomcat.apache.org ● users@httpd.apache.org ● users@trafficserver.apache.org ● https://http2.github.io/ ● Demo generator: – https://github.com/jfclere/h2_demos 11/18/16 27