MCPcopy Create free account
hub / github.com/XTLS/Go / serverHandshake

Method serverHandshake

handshake_server.go:42–63  ·  view source on GitHub ↗

serverHandshake performs a TLS handshake as a server.

(ctx context.Context)

Source from the content-addressed store, hash-verified

40
41// serverHandshake performs a TLS handshake as a server.
42func (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
65func (hs *serverHandshakeState) handshake() error {
66 c := hs.c

Callers

nothing calls this directly

Calls 2

readClientHelloMethod · 0.95
handshakeMethod · 0.95

Tested by

no test coverage detected