serverHandshake performs a TLS handshake as a server.
(ctx context.Context)
| 40 | |
| 41 | // serverHandshake performs a TLS handshake as a server. |
| 42 | func (c *Conn) serverHandshake(ctx context.Context) error { |
| 43 | clientHello, err := c.readClientHello(ctx) |
| 44 | if err != nil { |
| 45 | return err |
| 46 | } |
| 47 | |
| 48 | if c.vers == VersionTLS13 { |
| 49 | hs := serverHandshakeStateTLS13{ |
| 50 | c: c, |
| 51 | ctx: ctx, |
| 52 | clientHello: clientHello, |
| 53 | } |
| 54 | return hs.handshake() |
| 55 | } |
| 56 | |
| 57 | hs := serverHandshakeState{ |
| 58 | c: c, |
| 59 | ctx: ctx, |
| 60 | clientHello: clientHello, |
| 61 | } |
| 62 | return hs.handshake() |
| 63 | } |
| 64 | |
| 65 | func (hs *serverHandshakeState) handshake() error { |
| 66 | c := hs.c |
nothing calls this directly
no test coverage detected