21
SSL/TLS with Varnish Plus

Varnish SSL / TLS

Embed Size (px)

Citation preview

Page 1: Varnish SSL / TLS

SSL/TLS with Varnish Plus

Page 2: Varnish SSL / TLS

Agenda

● SSL/TLS● Client-side TLS with Hitch TLS● TLS to the backend with Varnish Cache Plus

Page 3: Varnish SSL / TLS

TLS basics● TLS - standardised encryption protocol

○ Confidentiality○ Authentication○ Integrity

● Lives on top of TCP, below HTTP● TLS is originally based on SSL● All SSL versions are broken● TLS 1.2 is the one you should use

Page 4: Varnish SSL / TLS

Hitch TLS

● A small and fast TLS terminator● Developed by Varnish Software● Hitch TLS is bundled with Varnish Plus

○ Official packages and support● Based on the “stud” project by Bump

Technologies● Freely available. BSD license● https://hitch-tls.org/

Page 5: Varnish SSL / TLS

● Event-driven using libev ● Non-blocking IO● One main management process● N child processes, doing the actual heavy

lifting

Architecture

Page 6: Varnish SSL / TLS

Setup and configuration● Official packages available with Varnish Plus● Community packages for Debian and

RHEL/Fedora and FreeBSD● Latest release 1.2.0-beta1● Configuration in /etc/hitch/hitch.conf

Page 7: Varnish SSL / TLS
Page 8: Varnish SSL / TLS

PROXY protocol● Transmit client endpoints in a tiny preamble● Specified by Willy Tarreau of HAProxy● Example PROXYv1 header:

PROXY TCP4 192.168.0.1 192.168.0.11 56324 443\r\n

● Supported in Varnish Cache Plus 4.0- and in Varnish 4.1.○ VCL: client.ip, server.ip, remote.ip, local.ip

Page 9: Varnish SSL / TLS

Run-time reloads● New in Hitch● Seamlessly load new certificates and listen

endpoints without interrupting service● Hitch will re-read its config on SIGHUP

# service hitch reload

Page 10: Varnish SSL / TLS

Performance● In short: very good● Scales with any (reasonable) number of CPU

cores● Up to 3000 new connections per second per

core (“SSL accelerator” cards not needed)● Fills 10Gbit ethernet without much effort● Tested with 500K certificates

Page 11: Varnish SSL / TLS

Future improvements

● Improved configuration flexibility (in beta now)● OCSP stapling● Shared session cache improvements● ALPN/NPN for HTTP/2

Page 12: Varnish SSL / TLS

TLS to the backend● Built into Varnish Cache Plus from 4.0.3r3

(June 2015)● Add “.ssl = 1” to backend definition to

use TLS● SNI on by default.● Other options: disable SNI and certificate

checking.

Page 13: Varnish SSL / TLS
Page 14: Varnish SSL / TLS

Backend performance test

● nginx backend with TLS on 10Gb LAN● wrk toward local Varnish● Focus on latency, not throughput

Page 15: Varnish SSL / TLS
Page 16: Varnish SSL / TLS
Page 17: Varnish SSL / TLS
Page 18: Varnish SSL / TLS

Backend TLS performance

● On a LAN: costly, but still very fast

● On a WAN: smaller differences, but the extra roundtrips will slow down the first request

● Once established the TLS connections are fast

Page 19: Varnish SSL / TLS

Backend TLS future

● Feature complete● Ongoing support in Varnish Cache Plus

Page 20: Varnish SSL / TLS

Summary

● You can do TLS/SSL both to the client and to the backend with Varnish Plus

● All components are supported in Plus.● High performance is ensured.

Page 21: Varnish SSL / TLS

Questions?