FAQ
Reviewers: bradfitz,

Message:
Hello bradfitz@golang.org (cc: golang-dev@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/go


Description:
net/http: use tls host instead of proxy, when checking against a
certificate

Fixes issue 4152.

Please review this at http://codereview.appspot.com/6570045/

Affected files:
M src/pkg/net/http/transport.go


Index: src/pkg/net/http/transport.go
===================================================================
--- a/src/pkg/net/http/transport.go
+++ b/src/pkg/net/http/transport.go
@@ -381,7 +381,7 @@
// Initiate TLS and check remote host name against certificate.
cfg := t.TLSClientConfig
if cfg == nil || cfg.ServerName == "" {
- host, _, _ := net.SplitHostPort(cm.addr())
+ host := cm.tlsHost()
if cfg == nil {
cfg = &tls.Config{ServerName: host}
} else {

Search Discussions

  • Brad Fitzpatrick at Sep 25, 2012 at 4:23 pm
    LGTM

    Wish this had a test, but there's not a simple way to modify an existing
    test to cover this, so I'm happy that "go get" now works via a proxy.

    Thanks!

    On Tue, Sep 25, 2012 at 7:55 AM, wrote:

    Reviewers: bradfitz,

    Message:
    Hello bradfitz@golang.org (cc: golang-dev@googlegroups.com),

    I'd like you to review this change to
    https://code.google.com/p/go


    Description:
    net/http: use tls host instead of proxy, when checking against a
    certificate

    Fixes issue 4152.

    Please review this at http://codereview.appspot.com/**6570045/<http://codereview.appspot.com/6570045/>

    Affected files:
    M src/pkg/net/http/transport.go


    Index: src/pkg/net/http/transport.go
    ==============================**==============================**=======
    --- a/src/pkg/net/http/transport.**go
    +++ b/src/pkg/net/http/transport.**go
    @@ -381,7 +381,7 @@
    // Initiate TLS and check remote host name against
    certificate.
    cfg := t.TLSClientConfig
    if cfg == nil || cfg.ServerName == "" {
    - host, _, _ := net.SplitHostPort(cm.addr())
    + host := cm.tlsHost()
    if cfg == nil {
    cfg = &tls.Config{ServerName: host}
    } else {

  • Bradfitz at Sep 25, 2012 at 4:23 pm
    *** Submitted as
    http://code.google.com/p/go/source/detail?r=c70d7dfc3d07 ***

    net/http: use tls host instead of proxy, when checking against a
    certificate

    Fixes issue 4152.

    R=bradfitz
    CC=golang-dev
    http://codereview.appspot.com/6570045

    Committer: Brad Fitzpatrick <bradfitz@golang.org>


    http://codereview.appspot.com/6570045/
  • Chressie at Sep 26, 2012 at 12:19 pm

    On 2012/09/25 16:22:59, bradfitz wrote:
    Wish this had a test, but there's not a simple way to modify an existing
    test to cover this, so I'm happy that "go get" now works via a proxy.
    yes, i didn't see a simple way as well. it would be nice to have a proxy
    implementation and i think it's not feasible to use an open proxy in the
    web for testing that.

    cheers..

    http://codereview.appspot.com/6570045/
  • Brad Fitzpatrick at Sep 26, 2012 at 4:19 pm

    On Wed, Sep 26, 2012 at 5:19 AM, wrote:
    On 2012/09/25 16:22:59, bradfitz wrote:

    Wish this had a test, but there's not a simple way to modify an existing
    test to cover this, so I'm happy that "go get" now works via a proxy.
    yes, i didn't see a simple way as well. it would be nice to have a proxy
    implementation and i think it's not feasible to use an open proxy in the
    web for testing that.
    shouldn't be hard with httputil's reverse proxy code. want to work on one
    to be used in the tests? then we can pass it flags to have a "fake DNS"
    mode where certain hostnames are hard-coded to be localhost for tests.
  • Christian Himpel at Sep 26, 2012 at 4:44 pm

    On Wed, Sep 26, 2012 at 5:25 PM, Brad Fitzpatrick wrote:
    shouldn't be hard with httputil's reverse proxy code. want to work on one
    to be used in the tests? then we can pass it flags to have a "fake DNS"
    mode where certain hostnames are hard-coded to be localhost for tests.
    cool, if it's not too urgent to have a test here, i'd like to take a
    look when i have some spare time.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedSep 25, '12 at 3:24p
activeSep 26, '12 at 4:44p
posts6
users2
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase