MCPcopy Create free account
hub / github.com/tailscale/tailscale / Client

Function Client

control/controlbase/handshake.go:109–118  ·  view source on GitHub ↗

Client wraps ClientDeferred and immediately invokes the returned continuation with conn. This is a helper for when you don't need the fancy continuation-style handshake, and just want to synchronously upgrade a net.Conn to a secure transport.

(ctx context.Context, conn net.Conn, machineKey key.MachinePrivate, controlKey key.MachinePublic, protocolVersion uint16)

Source from the content-addressed store, hash-verified

107// continuation-style handshake, and just want to synchronously
108// upgrade a net.Conn to a secure transport.
109func Client(ctx context.Context, conn net.Conn, machineKey key.MachinePrivate, controlKey key.MachinePublic, protocolVersion uint16) (*Conn, error) {
110 init, cont, err := ClientDeferred(machineKey, controlKey, protocolVersion)
111 if err != nil {
112 return nil, err
113 }
114 if _, err := conn.Write(init); err != nil {
115 return nil, err
116 }
117 return cont(ctx, conn)
118}
119
120func continueClientHandshake(ctx context.Context, conn net.Conn, s *symmetricState, machineKey, machineEphemeral key.MachinePrivate, controlKey key.MachinePublic, protocolVersion uint16) (*Conn, error) {
121 // No matter what, this function can only run once per s. Ensure

Callers 6

TestConnStdFunction · 0.70
pairWithConnsFunction · 0.70
TestHandshakeFunction · 0.70
TestNoReuseFunction · 0.70
TestTamperingFunction · 0.70
TestInteropServerFunction · 0.70

Calls 2

ClientDeferredFunction · 0.85
WriteMethod · 0.65

Tested by 6

TestConnStdFunction · 0.56
pairWithConnsFunction · 0.56
TestHandshakeFunction · 0.56
TestNoReuseFunction · 0.56
TestTamperingFunction · 0.56
TestInteropServerFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…