]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: add KeyLogWriter for debugging
authorJoonas Kuorilehto <joneskoo@derbian.fi>
Sat, 20 Aug 2016 11:41:42 +0000 (14:41 +0300)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 27 Aug 2016 17:20:55 +0000 (17:20 +0000)
commit320bd562cbb24a01beb02706c42d06a290160645
tree9326a1d27c6a5e4bcdf611ec110b88cf0e8a1cf2
parent3427f16642a1c207db4a4c3cce912dfdce2ac9f5
crypto/tls: add KeyLogWriter for debugging

Add support for writing TLS client random and master secret
in NSS key log format.

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format

Normally this is enabled by a developer debugging TLS based
applications, especially HTTP/2, by setting the KeyLogWriter
to an open file. The keys negotiated in handshake are then
logged and can be used to decrypt TLS sessions e.g. in Wireshark.

Applications may choose to add support similar to NSS where this
is enabled by environment variable, but no such mechanism is
built in to Go. Instead each application must explicitly enable.

Fixes #13057.

Change-Id: If6edd2d58999903e8390b1674ba4257ecc747ae1
Reviewed-on: https://go-review.googlesource.com/27434
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/crypto/tls/common.go
src/crypto/tls/handshake_client.go
src/crypto/tls/handshake_client_test.go
src/crypto/tls/handshake_server.go
src/crypto/tls/handshake_server_test.go
src/crypto/tls/testdata/Client-TLSv10-KeyLogWriter [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv10-KeyLogWriter [new file with mode: 0644]
src/crypto/tls/tls_test.go
src/net/http/transport.go