Skip to content
Snippets Groups Projects
Commit afaee6e9 authored by Jonah Husson's avatar Jonah Husson
Browse files

Add comments & fixes from mr

parent 55f38103
No related branches found
No related tags found
3 merge requests!39Merge release into master,!34Update to use modified client, add params for relevant options, enable use of tls with web conn,!32Project/channels
...@@ -236,9 +236,11 @@ func (c *ProtoComms) ServeWithWeb() { ...@@ -236,9 +236,11 @@ func (c *ProtoComms) ServeWithWeb() {
jww.ERROR.Printf("Failed to serve HTTP: %v", err) jww.ERROR.Printf("Failed to serve HTTP: %v", err)
} }
} else { } else {
// Configure tls for this listener, using the config from http.ServeTLS
tlsConf := &tls.Config{} tlsConf := &tls.Config{}
tlsConf.NextProtos = append(tlsConf.NextProtos, "http/1.1") tlsConf.NextProtos = append(tlsConf.NextProtos, "http/1.1")
tlsConf.Certificates = make([]tls.Certificate, 1) tlsConf.Certificates = make([]tls.Certificate, 1)
// Our internal certificates may not pass standard verification
tlsConf.InsecureSkipVerify = true tlsConf.InsecureSkipVerify = true
var err error var err error
tlsConf.Certificates[0], err = tls.X509KeyPair(c.pubKeyPem, rsa.CreatePrivateKeyPem(c.privateKey)) tlsConf.Certificates[0], err = tls.X509KeyPair(c.pubKeyPem, rsa.CreatePrivateKeyPem(c.privateKey))
......
...@@ -9,9 +9,26 @@ import ( ...@@ -9,9 +9,26 @@ import (
"time" "time"
) )
// WebConnParam struct holds parameters used
// for establishing a grpc-web connection
// The params are used when estabilishing the http connection
type WebConnParam struct { type WebConnParam struct {
/* 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 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 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 ExpectContinueTimeout time.Duration
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment