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
822804c6
Commit
822804c6
authored
Aug 26, 2011
by
Brad Fitzpatrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: support setting Transport's TLS client config
R=golang-dev, adg CC=golang-dev
https://golang.org/cl/4964043
parent
a45c657d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/pkg/http/transport.go
src/pkg/http/transport.go
+5
-1
No files found.
src/pkg/http/transport.go
View file @
822804c6
...
@@ -54,6 +54,10 @@ type Transport struct {
...
@@ -54,6 +54,10 @@ type Transport struct {
// If Dial is nil, net.Dial is used.
// If Dial is nil, net.Dial is used.
Dial
func
(
net
,
addr
string
)
(
c
net
.
Conn
,
err
os
.
Error
)
Dial
func
(
net
,
addr
string
)
(
c
net
.
Conn
,
err
os
.
Error
)
// TLSClientConfig specifies the TLS configuration to use with
// tls.Client. If nil, the default configuration is used.
TLSClientConfig
*
tls
.
Config
DisableKeepAlives
bool
DisableKeepAlives
bool
DisableCompression
bool
DisableCompression
bool
...
@@ -338,7 +342,7 @@ func (t *Transport) getConn(cm *connectMethod) (*persistConn, os.Error) {
...
@@ -338,7 +342,7 @@ func (t *Transport) getConn(cm *connectMethod) (*persistConn, os.Error) {
if
cm
.
targetScheme
==
"https"
{
if
cm
.
targetScheme
==
"https"
{
// Initiate TLS and check remote host name against certificate.
// Initiate TLS and check remote host name against certificate.
conn
=
tls
.
Client
(
conn
,
nil
)
conn
=
tls
.
Client
(
conn
,
t
.
TLSClientConfig
)
if
err
=
conn
.
(
*
tls
.
Conn
)
.
Handshake
();
err
!=
nil
{
if
err
=
conn
.
(
*
tls
.
Conn
)
.
Handshake
();
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
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