]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document cloning of Server.TLSConfig
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 5 Jan 2018 21:31:57 +0000 (21:31 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 6 Jan 2018 01:02:29 +0000 (01:02 +0000)
Updates #22018

Change-Id: I8a85324e9d53dd4d279ed05cdb93f50d55cf767b
Reviewed-on: https://go-review.googlesource.com/86415
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/http/server.go

index ceb1a047cf57667741e4aec2d62b7be4b0378c52..35adb87c63ffb543cb20b90dacd590fdb90aaece 100644 (file)
@@ -2394,9 +2394,17 @@ func ServeTLS(l net.Listener, handler Handler, certFile, keyFile string) error {
 // A Server defines parameters for running an HTTP server.
 // The zero value for Server is a valid configuration.
 type Server struct {
-       Addr      string      // TCP address to listen on, ":http" if empty
-       Handler   Handler     // handler to invoke, http.DefaultServeMux if nil
-       TLSConfig *tls.Config // optional TLS config, used by ServeTLS and ListenAndServeTLS
+       Addr    string  // TCP address to listen on, ":http" if empty
+       Handler Handler // handler to invoke, http.DefaultServeMux if nil
+
+       // TLSConfig optionally provides a TLS configuration for use
+       // by ServeTLS and ListenAndServeTLS. Note that this value is
+       // cloned by ServeTLS and ListenAndServeTLS, so it's not
+       // possible to modify the configuration with methods like
+       // tls.Config.SetSessionTicketKeys. To use
+       // SetSessionTicketKeys, use Server.Serve with a TLS Listener
+       // instead.
+       TLSConfig *tls.Config
 
        // ReadTimeout is the maximum duration for reading the entire
        // request, including the body.