@@ -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.
468468func 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