Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
dc19b94b
Commit
dc19b94b
authored
Feb 21, 2012
by
Brad Fitzpatrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/http: add optional Server.TLSConfig field
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/5688047
parent
dff5535a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/pkg/net/http/server.go
src/pkg/net/http/server.go
+7
-4
No files found.
src/pkg/net/http/server.go
View file @
dc19b94b
...
...
@@ -12,7 +12,6 @@ package http
import
(
"bufio"
"bytes"
"crypto/rand"
"crypto/tls"
"errors"
"fmt"
...
...
@@ -985,6 +984,7 @@ type Server struct {
ReadTimeout
time
.
Duration
// maximum duration before timing out read of the request
WriteTimeout
time
.
Duration
// maximum duration before timing out write of the response
MaxHeaderBytes
int
// maximum size of request headers, DefaultMaxHeaderBytes if 0
TLSConfig
*
tls
.
Config
// optional TLS config, used by ListenAndServeTLS
}
// ListenAndServe listens on the TCP network address srv.Addr and then
...
...
@@ -1121,9 +1121,12 @@ func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error {
if
addr
==
""
{
addr
=
":https"
}
config
:=
&
tls
.
Config
{
Rand
:
rand
.
Reader
,
NextProtos
:
[]
string
{
"http/1.1"
},
config
:=
&
tls
.
Config
{}
if
srv
.
TLSConfig
!=
nil
{
*
config
=
*
srv
.
TLSConfig
}
if
config
.
NextProtos
==
nil
{
config
.
NextProtos
=
[]
string
{
"http/1.1"
}
}
var
err
error
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment