Skip to content

Commit 9dc297f

Browse files
committed
Add client cert fixture for TLS tests
1 parent ed073de commit 9dc297f

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

.github/testdata/client.pem

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIICoDCCAYgCAQEwDQYJKoZIhvcNAQELBQAwFTETMBEGA1UEAxMKdWJ1bnR1Lm5h
3+
bjAeFw0yNjAxMjAxMjU0MTlaFw0yNzAxMjAxMjU0MTlaMBcxFTATBgNVBAMMDGZp
4+
YmVyLWNsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIR2LdaC
5+
B8whFUqOibZFR/K/B2jAn+QCLQpmv5TReMoZ1KS7eeScyGPyS0VH1WWUf75C7DPV
6+
Vlbm/nOH4F+dIcosavKHrJz/K/m7cZuiqeAu8jWudGrtkT+aplMg/96Rv48LzNi+
7+
c1uFFUGAGI+1YLQoa8IezZpckOfekL7dqcg/eL6FnPVDukwOKZ9jTl/6+Lpji7ae
8+
NZjfwD4S9Mi2FrtJTtGSM4Y5W2DnuxaaOp4qzOHp+trg06EEIBbqvGnJyadaei/3
9+
1yUmc61C6MtFZ5hCGkymyBNy2+mYeB3MCurWgc9GZnLheRzM3CmTlqpzlD04Bjof
10+
7wLczIZdLLiwg/cCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAB0+GJAhrZSUw4Z/u
11+
LcTa7kDCJTcdM326yVyjtoZCOXOM8v0Dvpe94or1d7P/vK2YHKGrN65Koyag1fWM
12+
gq1ly4ctczuCZmKGbw6d7lZbna33XCnwwernFUJrkHsodYfO+PGiLvBsacja6f9e
13+
AuAWvzKasOAkaA8w7+L81hzfP3vRVFx1CUw2tOKvDR/JZ1ylSuilg59AYN1HFYAO
14+
LVH+yKvPNJDpFYZU56GbzL4a2mwG87jVFSwszwohwtqvOxxWLtOSy0iLdTAwbTED
15+
SPlD+YaUVupUMOhyjPS+9TYGzINbGq8/QzN7MWJv61PC2cclWH70cE0Q+1yB5E1V
16+
4IMt6w==
17+
-----END CERTIFICATE-----

listen_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func Test_Listen_TLS_PEM(t *testing.T) {
256256
t.Parallel()
257257

258258
creds := readTLSPEM(t, "./.github/testdata/ssl.pem", "./.github/testdata/ssl.key")
259-
clientPEM, err := os.ReadFile(filepath.Clean("./.github/testdata/ca-chain.cert.pem"))
259+
clientPEM, err := os.ReadFile(filepath.Clean("./.github/testdata/client.pem"))
260260
require.NoError(t, err)
261261

262262
t.Run("ServerCertOnly", func(t *testing.T) {
@@ -298,7 +298,7 @@ func Test_Listen_TLS_PEM_Validation(t *testing.T) {
298298
t.Parallel()
299299

300300
creds := readTLSPEM(t, "./.github/testdata/ssl.pem", "./.github/testdata/ssl.key")
301-
clientPEM, err := os.ReadFile(filepath.Clean("./.github/testdata/ca-chain.cert.pem"))
301+
clientPEM, err := os.ReadFile(filepath.Clean("./.github/testdata/client.pem"))
302302
require.NoError(t, err)
303303

304304
t.Run("MissingKey", func(t *testing.T) {
@@ -441,7 +441,7 @@ func Test_Listen_TLS_PEM_Validation(t *testing.T) {
441441
CertPEM: creds.cert,
442442
CertKeyPEM: creds.key,
443443
CertClientPEM: badClientPEM,
444-
CertClientFile: "./.github/testdata/ca-chain.cert.pem",
444+
CertClientFile: "./.github/testdata/client.pem",
445445
})
446446
require.Error(t, err)
447447
require.ErrorContains(t, err, "tls: CertClientPEM does not match certClientFile")
@@ -529,7 +529,7 @@ func Test_Listen_MutualTLS(t *testing.T) {
529529
require.Error(t, app.Listen(":99999", ListenConfig{
530530
CertFile: "./.github/testdata/ssl.pem",
531531
CertKeyFile: "./.github/testdata/ssl.key",
532-
CertClientFile: "./.github/testdata/ca-chain.cert.pem",
532+
CertClientFile: "./.github/testdata/client.pem",
533533
}))
534534

535535
go func() {
@@ -540,7 +540,7 @@ func Test_Listen_MutualTLS(t *testing.T) {
540540
require.NoError(t, app.Listen(":0", ListenConfig{
541541
CertFile: "./.github/testdata/ssl.pem",
542542
CertKeyFile: "./.github/testdata/ssl.key",
543-
CertClientFile: "./.github/testdata/ca-chain.cert.pem",
543+
CertClientFile: "./.github/testdata/client.pem",
544544
}))
545545
}
546546

@@ -556,7 +556,7 @@ func Test_Listen_MutualTLS_Prefork(t *testing.T) {
556556
EnablePrefork: true,
557557
CertFile: "./.github/testdata/ssl.pem",
558558
CertKeyFile: "./.github/testdata/template.html",
559-
CertClientFile: "./.github/testdata/ca-chain.cert.pem",
559+
CertClientFile: "./.github/testdata/client.pem",
560560
}))
561561

562562
go func() {
@@ -569,7 +569,7 @@ func Test_Listen_MutualTLS_Prefork(t *testing.T) {
569569
EnablePrefork: true,
570570
CertFile: "./.github/testdata/ssl.pem",
571571
CertKeyFile: "./.github/testdata/ssl.key",
572-
CertClientFile: "./.github/testdata/ca-chain.cert.pem",
572+
CertClientFile: "./.github/testdata/client.pem",
573573
}))
574574
}
575575

0 commit comments

Comments
 (0)