@@ -6,7 +6,6 @@ package tls
6
6
7
7
import (
8
8
"bytes"
9
- "context"
10
9
"crypto/rsa"
11
10
"crypto/x509"
12
11
"encoding/base64"
@@ -21,7 +20,6 @@ import (
21
20
"os/exec"
22
21
"path/filepath"
23
22
"reflect"
24
- "runtime"
25
23
"strconv"
26
24
"strings"
27
25
"testing"
@@ -2513,37 +2511,3 @@ func testResumptionKeepsOCSPAndSCT(t *testing.T, ver uint16) {
2513
2511
serverConfig .Certificates [0 ].SignedCertificateTimestamps , ccs .SignedCertificateTimestamps )
2514
2512
}
2515
2513
}
2516
-
2517
- func TestClientHandshakeContextCancellation (t * testing.T ) {
2518
- c , s := localPipe (t )
2519
- serverConfig := testConfig .Clone ()
2520
- serverErr := make (chan error , 1 )
2521
- ctx , cancel := context .WithCancel (context .Background ())
2522
- defer cancel ()
2523
- go func () {
2524
- defer close (serverErr )
2525
- defer s .Close ()
2526
- conn := Server (s , serverConfig )
2527
- _ , err := conn .readClientHello (ctx )
2528
- cancel ()
2529
- serverErr <- err
2530
- }()
2531
- cli := Client (c , testConfig )
2532
- err := cli .HandshakeContext (ctx )
2533
- if err == nil {
2534
- t .Fatal ("Client handshake did not error when the context was canceled" )
2535
- }
2536
- if err != context .Canceled {
2537
- t .Errorf ("Unexpected client handshake error: %v" , err )
2538
- }
2539
- if err := <- serverErr ; err != nil {
2540
- t .Errorf ("Unexpected server error: %v" , err )
2541
- }
2542
- if runtime .GOARCH == "wasm" {
2543
- t .Skip ("conn.Close does not error as expected when called multiple times on WASM" )
2544
- }
2545
- err = cli .Close ()
2546
- if err == nil {
2547
- t .Error ("Client connection was not closed when the context was canceled" )
2548
- }
2549
- }
0 commit comments