newTestServerWithHandshakeFunc starts a new testServer which listens for connections on a local TCP port, and uses the provided custom handshake function to perform TLS handshake.
(ctx context.Context, f testHandshakeFunc)
| 96 | // connections on a local TCP port, and uses the provided custom handshake |
| 97 | // function to perform TLS handshake. |
| 98 | func newTestServerWithHandshakeFunc(ctx context.Context, f testHandshakeFunc) *testServer { |
| 99 | ts := &testServer{ |
| 100 | handshakeFunc: f, |
| 101 | hsResult: testutils.NewChannel(), |
| 102 | } |
| 103 | ts.start(ctx) |
| 104 | return ts |
| 105 | } |
| 106 | |
| 107 | // starts actually starts listening on a local TCP port, and spawns a goroutine |
| 108 | // to handle new connections. |
no test coverage detected