Alternative TLS implementation in Go
Go to file
Tom Bergan 9f2da1d218 crypto/tls: implement dynamic record sizing
Currently, if a client of crypto/tls (e.g., net/http, http2) calls
tls.Conn.Write with a 33KB buffer, that ends up writing three TLS
records: 16KB, 16KB, and 1KB. Slow clients (such as 2G phones) must
download the first 16KB record before they can decrypt the first byte.
To improve latency, it's better to send smaller TLS records. However,
sending smaller records adds overhead (more overhead bytes and more
crypto calls), which slightly hurts throughput.

A simple heuristic, implemented in this change, is to send small
records for new connections, then boost to large records after the
first 1MB has been written on the connection.

Fixes #14376

Change-Id: Ice0f6279325be6775aa55351809f88e07dd700cd
Reviewed-on: https://go-review.googlesource.com/19591
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
Reviewed-by: Adam Langley <agl@golang.org>
2016-03-12 00:47:13 +00:00
testdata crypto/tls: add TLS_RSA_WITH_AES_128_GCM_SHA256 and TLS_RSA_WITH_AES_256_GCM_SHA384 cipher suites 2015-11-15 20:59:11 +00:00
alert.go crypto/tls: support TLS_FALLBACK_SCSV as a server. 2014-10-15 17:54:04 -07:00
cipher_suites.go crypto/tls: document that the cipher suite list is non-exhaustive. 2016-03-12 00:20:51 +00:00
common.go crypto/tls: implement dynamic record sizing 2016-03-12 00:47:13 +00:00
conn_test.go crypto/tls: implement dynamic record sizing 2016-03-12 00:47:13 +00:00
conn.go crypto/tls: implement dynamic record sizing 2016-03-12 00:47:13 +00:00
example_test.go crypto/x509: add example of using a custom root list. 2014-02-19 11:18:35 -05:00
generate_cert.go crypto/tls: Support ECDSA keys in generate_cert.go 2014-07-28 14:46:34 -07:00
handshake_client_test.go crypto/tls: check errors from (*Conn).writeRecord 2016-03-02 18:20:46 +00:00
handshake_client.go crypto/tls: check errors from (*Conn).writeRecord 2016-03-02 18:20:46 +00:00
handshake_messages_test.go crypto/tls: decouple handshake signatures from the handshake hash. 2015-04-30 03:47:02 +00:00
handshake_messages.go crypto/tls: reject ServerHellos with empty ALPN protocols. 2015-08-30 15:33:36 +00:00
handshake_server_test.go crypto/tls: check errors from (*Conn).writeRecord 2016-03-02 18:20:46 +00:00
handshake_server.go crypto/tls: check errors from (*Conn).writeRecord 2016-03-02 18:20:46 +00:00
handshake_test.go crypto/tls: rework reference tests. 2013-12-20 11:37:05 -05:00
key_agreement.go all: single space after period. 2016-03-02 00:13:47 +00:00
prf_test.go crypto/tls: decouple handshake signatures from the handshake hash. 2015-04-30 03:47:02 +00:00
prf.go crypto/tls: len(clientRandom) used for serverRandom source 2015-11-10 22:17:54 +00:00
ticket.go crypto/tls: add support for session ticket key rotation 2015-04-26 20:57:28 +00:00
tls_test.go crypto/tls: test for timeout error using the net.Error interface 2016-03-08 22:40:49 +00:00
tls.go all: remove public named return values when useless 2016-02-29 03:31:19 +00:00