Remove testutil.TLSTestServerWithCert in favor of the testutil/tlsserver package

This commit is contained in:
Joshua Casey
2024-04-19 10:20:41 -05:00
parent da135d9958
commit 94bee9e882
15 changed files with 175 additions and 210 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2021 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package phttp
@@ -83,13 +83,13 @@ func TestClient(t *testing.T) {
t.Parallel()
var sawRequest bool
server := tlsserver.TLSTestServer(t, http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) {
server, serverCA := tlsserver.TestServerIPv4(t, http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) {
tlsserver.AssertTLS(t, r, tt.configFunc)
assertUserAgent(t, r)
sawRequest = true
}), tlsserver.RecordTLSHello)
rootCAs, err := cert.NewPoolFromBytes(tlsserver.TLSTestServerCA(server))
rootCAs, err := cert.NewPoolFromBytes(serverCA)
require.NoError(t, err)
c := tt.clientFunc(rootCAs)