FAQ
the code:

url := "https://a_HTTPS_web_site.com"
os.Setenv("HTTP_PROXY", "http://proxy.com:1080")

client := &http.Client{}
reqest, _ := http.NewRequest("GET", url, nil)

response, err := client.Do(reqest)
// ...
--------------------------------------------------------------

when run the code, has error:
certificate is valid for a_HTTPS_web_site.com, not proxy.com

How to solve this problem? Thanks.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Cem Ezberci at Mar 23, 2013 at 4:06 pm
    You are setting the wrong env variable. You should set HTTPS_PROXY (or
    https_proxy) for this to work. Alternatively, you can do this in the
    command line before executing your code instead of in the code.

    -Cem
    On Saturday, March 23, 2013 11:07:26 AM UTC-4, Eucal J wrote:

    the code:

    url := "https://a_HTTPS_web_site.com"
    os.Setenv("HTTP_PROXY", "http://proxy.com:1080")

    client := &http.Client{}
    reqest, _ := http.NewRequest("GET", url, nil)

    response, err := client.Do(reqest)
    // ...
    --------------------------------------------------------------

    when run the code, has error:
    certificate is valid for a_HTTPS_web_site.com, not proxy.com

    How to solve this problem? Thanks.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Cem Ezberci at Mar 23, 2013 at 11:17 pm
    apparently I spoke too soon. Looking at transport.go in net/http package,
    it doesn't look like https_proxy or HTTPS_PROXY is honored.. However I was
    able to make a call to an https URL with a proxy set at HTTP_PROXY env
    variable.

    Would you be able to post your code somewhere so we can take a look?

    -Cem
    On Saturday, March 23, 2013 12:06:02 PM UTC-4, Cem Ezberci wrote:

    You are setting the wrong env variable. You should set HTTPS_PROXY (or
    https_proxy) for this to work. Alternatively, you can do this in the
    command line before executing your code instead of in the code.

    -Cem
    On Saturday, March 23, 2013 11:07:26 AM UTC-4, Eucal J wrote:

    the code:

    url := "https://a_HTTPS_web_site.com"
    os.Setenv("HTTP_PROXY", "http://proxy.com:1080")

    client := &http.Client{}
    reqest, _ := http.NewRequest("GET", url, nil)

    response, err := client.Do(reqest)
    // ...
    --------------------------------------------------------------

    when run the code, has error:
    certificate is valid for a_HTTPS_web_site.com, not proxy.com

    How to solve this problem? Thanks.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Eucal J at Mar 24, 2013 at 12:10 am
    This is the whole code, the proxy is used by Goagent, a python proxy by
    GAE. https://code.google.com/p/goagent/

    在 2013年3月24日星期日UTC+8上午7时17分53秒,Cem Ezberci写道:
    apparently I spoke too soon. Looking at transport.go in net/http package,
    it doesn't look like https_proxy or HTTPS_PROXY is honored.. However I was
    able to make a call to an https URL with a proxy set at HTTP_PROXY env
    variable.

    Would you be able to post your code somewhere so we can take a look?

    -Cem
    On Saturday, March 23, 2013 12:06:02 PM UTC-4, Cem Ezberci wrote:

    You are setting the wrong env variable. You should set HTTPS_PROXY (or
    https_proxy) for this to work. Alternatively, you can do this in the
    command line before executing your code instead of in the code.

    -Cem
    On Saturday, March 23, 2013 11:07:26 AM UTC-4, Eucal J wrote:

    the code:

    url := "https://a_HTTPS_web_site.com"
    os.Setenv("HTTP_PROXY", "http://proxy.com:1080")

    client := &http.Client{}
    reqest, _ := http.NewRequest("GET", url, nil)

    response, err := client.Do(reqest)
    // ...
    --------------------------------------------------------------

    when run the code, has error:
    certificate is valid for a_HTTPS_web_site.com, not proxy.com

    How to solve this problem? Thanks.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Voidlogic7 at Mar 23, 2013 at 8:00 pm
    Check this out:
    http://stackoverflow.com/questions/14661511/setting-up-proxy-for-http-client/14663620#14663620
    On Saturday, March 23, 2013 10:07:26 AM UTC-5, Eucal J wrote:

    the code:

    url := "https://a_HTTPS_web_site.com"
    os.Setenv("HTTP_PROXY", "http://proxy.com:1080")

    client := &http.Client{}
    reqest, _ := http.NewRequest("GET", url, nil)

    response, err := client.Do(reqest)
    // ...
    --------------------------------------------------------------

    when run the code, has error:
    certificate is valid for a_HTTPS_web_site.com, not proxy.com

    How to solve this problem? Thanks.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Christian Himpel at Mar 24, 2013 at 7:44 am
    if you are using go1.0.3, this sounds like
    https://code.google.com/p/go/issues/detail?id=4152 which is fixed in tip.
    Am 23.03.2013 16:07 schrieb "Eucal J" <jeucal@gmail.com>:
    the code:

    url := "https://a_HTTPS_web_site.com"
    os.Setenv("HTTP_PROXY", "http://proxy.com:1080")

    client := &http.Client{}
    reqest, _ := http.NewRequest("GET", url, nil)

    response, err := client.Do(reqest)
    // ...
    --------------------------------------------------------------

    when run the code, has error:
    certificate is valid for a_HTTPS_web_site.com, not proxy.com

    How to solve this problem? Thanks.

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 23, '13 at 3:07p
activeMar 24, '13 at 7:44a
posts6
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase