diff --git a/connect/comms.go b/connect/comms.go index c7c8bb0e7c1c9f79a0d4f9110810056aa08c5f2b..afadf5f41ec35d5c999f94440371a1a568a6cfab 100644 --- a/connect/comms.go +++ b/connect/comms.go @@ -236,9 +236,11 @@ func (c *ProtoComms) ServeWithWeb() { jww.ERROR.Printf("Failed to serve HTTP: %v", err) } } else { + // Configure tls for this listener, using the config from http.ServeTLS tlsConf := &tls.Config{} tlsConf.NextProtos = append(tlsConf.NextProtos, "http/1.1") tlsConf.Certificates = make([]tls.Certificate, 1) + // Our internal certificates may not pass standard verification tlsConf.InsecureSkipVerify = true var err error tlsConf.Certificates[0], err = tls.X509KeyPair(c.pubKeyPem, rsa.CreatePrivateKeyPem(c.privateKey)) diff --git a/connect/webConn.go b/connect/webConn.go index 43d47bc43ae1915543877ac9a9dd758be36f8059..690ec3e55ae528defc0a24a14d93139014073305 100644 --- a/connect/webConn.go +++ b/connect/webConn.go @@ -9,9 +9,26 @@ import ( "time" ) +// WebConnParam struct holds parameters used +// for establishing a grpc-web connection +// The params are used when estabilishing the http connection type WebConnParam struct { - TlsHandshakeTimeout time.Duration - IdleConnTimeout time.Duration + /* HTTP Transport config options */ + // TLSHandshakeTimeout specifies the maximum amount of time waiting to + // wait for a TLS handshake. Zero means no timeout. + TlsHandshakeTimeout time.Duration + // IdleConnTimeout is the maximum amount of time an idle + // (keep-alive) connection will remain idle before closing + // itself. + // Zero means no limit. + IdleConnTimeout time.Duration + // ExpectContinueTimeout, if non-zero, specifies the amount of + // time to wait for a server's first response headers after fully + // writing the request headers if the request has an + // "Expect: 100-continue" header. Zero means no timeout and + // causes the body to be sent immediately, without + // waiting for the server to approve. + // This time does not include the time to send the request header. ExpectContinueTimeout time.Duration }