]> Cypherpunks repositories - gostls13.git/commit
net/http: remove test-only private key from production binaries
authorDamien Neil <dneil@google.com>
Thu, 10 Jun 2021 17:50:37 +0000 (10:50 -0700)
committerDamien Neil <dneil@google.com>
Thu, 10 Jun 2021 20:20:58 +0000 (20:20 +0000)
commit770f1de8c54256d5b17447028e47b201ba8e62c8
tree97fc72286cc4da4a5d2c92ce8f152235049fcee5
parent8d11b1d1172817359d08231deaf29f72d315b762
net/http: remove test-only private key from production binaries

The net/http/internal package contains a PEM-encoded private key used in
tests. This key is initialized at init time, which prevents it from
being stripped by the linker in non-test binaries.

Move the certificate and key to a new net/http/internal/testcert
package to ensure it is only included in binaries that reference it.

Fixes #46677.

Change-Id: Ie98bda529169314cc791063e7ce4d99ef99113c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/326771
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/go/build/deps_test.go
src/net/http/httptest/server.go
src/net/http/internal/testcert/testcert.go [moved from src/net/http/internal/testcert.go with 94% similarity]
src/net/http/serve_test.go
src/net/http/transport_internal_test.go
src/net/http/transport_test.go