Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Get https:/bucket/file: net/http: TLS handshake timeout #241

Open
jdoliner opened this issue Mar 8, 2015 · 4 comments
Open

Get https:/bucket/file: net/http: TLS handshake timeout #241

jdoliner opened this issue Mar 8, 2015 · 4 comments

Comments

@jdoliner
Copy link

jdoliner commented Mar 8, 2015

I'm having a problem where s3 gets are failing with:

Get https:/bucket/file: net/http: TLS handshake timeout

It seems like this is a somewhat known error with a couple of issues opened in other versions of this library, such as goamz/goamz#41. However there doesn't seem to be a good answer to this that I've found. Does anyone know of a way to work around this problem?

Another interesting thing about my problem. The code was working fine until recently and I haven't been able to find any changes in my code that would have broken this. Are there any changes to this repo that might have caused the problem?

@joelfgs
Copy link

joelfgs commented Mar 19, 2015

I'm also getting this net/http: TLS handshake timeout but it hits me when I push a large number of files (> 50 or so). When it happens some of the files are synced but others fail with this error.

@ghost
Copy link

ghost commented Apr 30, 2015

I am having the same issue using this I guess in Terraform.

@jgilik
Copy link

jgilik commented Jun 11, 2015

I stumbled into this issue with a project I'm working on (not goamz), but this is one of the higher-ranked search results for the error on Google. I run into this issue due to using rather large crypto keys on rather puny hardware.

I dealt with it by avoiding use of the net/http DefaultTransport / DefaultClient, and instead, initializing my own with TLSHandshakeTimeout configured reasonably:

        t := &http.Transport{
                Dial: (&net.Dialer{
                        Timeout: 60 * time.Second,
                        KeepAlive: 30 * time.Second,
                }).Dial,
                // We use ABSURDLY large keys, and should probably not.
                TLSHandshakeTimeout: 60 * time.Second,
        }
        c := &http.Client{
                Transport: t,
        }
        resp, err := c.Get("https://internal.lan/")

This seems to have resolved the net/http timeouts from the client side.

@naxhh
Copy link

naxhh commented Oct 2, 2015

I've a similar error when uploading a file in a busybox with CA certs.

Put https:/bucket/file: x509: failed to load system roots and no roots provided

x509 is related to CA certs. But as I said curls to other HTTPS works ok.
Docker image is radial/busyboxplus:curl

ADDED NOTE: In my case seems its because go expects certs to be in one file and the busybox image has them in many files. https://github.com/golang/go/blob/f9ed2f75c43cb8745a1593ec3e4208c46419216a/src/crypto/x509/root_linux.go

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants