MCPcopy Create free account
hub / github.com/cli/cli / serverConfig

Method serverConfig

script/ghmock/tls.go:114–127  ·  view source on GitHub ↗

serverConfig presents a certificate for the host gh names in its TLS handshake, or for fallback when it names none.

(fallback string)

Source from the content-addressed store, hash-verified

112// serverConfig presents a certificate for the host gh names in its TLS
113// handshake, or for fallback when it names none.
114func (ca *certAuthority) serverConfig(fallback string) *tls.Config {
115 return &tls.Config{
116 MinVersion: tls.VersionTLS12,
117 // The server inside the tunnel speaks HTTP/1.1 only.
118 NextProtos: []string{"http/1.1"},
119 GetCertificate: func(hello *tls.ClientHelloInfo) (*tls.Certificate, error) {
120 host := hello.ServerName
121 if host == "" {
122 host = fallback
123 }
124 return ca.leaf(host)
125 },
126 }
127}
128
129// bufferedConn reads first whatever the CONNECT request's reader buffered,
130// which can include the start of the TLS handshake.

Callers 1

tunnelMethod · 0.80

Calls 1

leafMethod · 0.95

Tested by

no test coverage detected