Skip to content

Commit 3d9d5e2

Browse files
authored
Cleanup go1.15.7 (letsencrypt#5374)
Remove code that is no longer needed after migrating to go1.16.x. Remove testing with go1.15.7 in the test matrix. Fixes letsencrypt#5321
1 parent c9c8a1a commit 3d9d5e2

File tree

4 files changed

+4
-35
lines changed

4 files changed

+4
-35
lines changed

.github/workflows/boulder-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
matrix:
3131
# Add additional docker image tags here and all tests will be run with the additional image.
3232
BOULDER_TOOLS_TAG:
33-
- go1.15.7_2021-03-29
3433
- go1.16.2_2021-03-29
3534
# Tests command definitions. Use the entire docker-compose command you want to run.
3635
tests:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
boulder:
4-
image: &boulder_image letsencrypt/boulder-tools:${BOULDER_TOOLS_TAG:-go1.15.7_2021-03-29}
4+
image: &boulder_image letsencrypt/boulder-tools:${BOULDER_TOOLS_TAG:-go1.16.2_2021-03-29}
55
environment:
66
FAKE_DNS: 10.77.77.77
77
BOULDER_CONFIG_DIR: test/config

va/tlsalpn.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ func certNames(cert *x509.Certificate) []string {
4848
}
4949
names = append(names, cert.DNSNames...)
5050
names = core.UniqueLowerNames(names)
51-
// TODO(#5321): This for loop can be deleted after new builds of boulder use
52-
// golang 1.16. In 1.16, code was added to crypto/x509 to not allow
53-
// invalid unicode into a DNSName in a SAN. An error will be caught in
54-
// the standard library before it gets to this point.
55-
for i, n := range names {
56-
names[i] = replaceInvalidUTF8([]byte(n))
57-
}
5851
return names
5952
}
6053

va/tlsalpn_test.go

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -464,34 +464,11 @@ func TestValidateTLSALPN01UnawareSrv(t *testing.T) {
464464

465465
// TestValidateTLSALPN01BadUTFSrv tests that validating TLS-ALPN-01 against
466466
// a host that returns a certificate with a SAN/CN that contains invalid UTF-8
467-
// will result in a problem with the invalid UTF-8 replaced.
467+
// will result in a problem with the invalid UTF-8.
468468
func TestValidateTLSALPN01BadUTFSrv(t *testing.T) {
469469
chall := tlsalpnChallenge()
470-
hs, err := tlsalpn01Srv(t, chall, IdPeAcmeIdentifier, 0, "localhost", "\xf0\x28\x8c\xbc")
471-
// TODO(#5321): Remove this comment and the err check below. In go1.16 and
472-
// greater tlsalpn01Srv is expected to fail because of invalid unicode
473-
// attempted in the certificate creation. If that error occurs, then
474-
// the standard library has done it's job and this test is satisfied.
475-
// If the error is for any other reason, the unit test will fail. In
476-
// 1.15.x this error is not expected and the other test cases will
477-
// continue.
478-
if err != nil {
479-
test.AssertContains(t, err.Error(), "cannot be encoded as an IA5String")
480-
return
481-
}
482-
port := getPort(hs)
483-
va, _ := setup(hs, 0, "", nil)
484-
485-
_, prob := va.validateTLSALPN01(ctx, dnsi("localhost"), chall)
486-
if prob == nil {
487-
t.Fatalf("TLS ALPN validation should have failed.")
488-
}
489-
test.AssertEquals(t, prob.Type, probs.UnauthorizedProblem)
490-
test.AssertEquals(t, prob.Detail, fmt.Sprintf(
491-
"Incorrect validation certificate for tls-alpn-01 challenge. "+
492-
"Requested localhost from 127.0.0.1:%d. Received 1 certificate(s), "+
493-
`first certificate had names "localhost, %s"`,
494-
port, "\ufffd(\ufffd\ufffd"))
470+
_, err := tlsalpn01Srv(t, chall, IdPeAcmeIdentifier, 0, "localhost", "\xf0\x28\x8c\xbc")
471+
test.AssertContains(t, err.Error(), "cannot be encoded as an IA5String")
495472
}
496473

497474
// TestValidateTLSALPN01MalformedExtnValue tests that validating TLS-ALPN-01

0 commit comments

Comments
 (0)