diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-08-16 10:38:45 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-08-16 10:38:54 -0600 |
commit | 2032d8c0f0abcb11c0bd4aa1285d57e7153fdb49 (patch) | |
tree | 14ad42a0e1c1b483f10fffc233baa6ab580ec7e9 | |
parent | c204c120177e37abf9ce089a6846fec4df7aec89 (diff) |
tls-getcerts: timeout TCP R/W after 5 sec.
-rw-r--r-- | tls-getcerts.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tls-getcerts.go b/tls-getcerts.go index 71fb8f4..34e25e5 100644 --- a/tls-getcerts.go +++ b/tls-getcerts.go @@ -12,6 +12,7 @@ import ( "net/url" "os" "strings" + "time" ) type xmppStreamsFeatures struct { @@ -118,6 +119,10 @@ func getcert(socket string) (*x509.Certificate, error) { if err != nil { return nil, err } + err = connRaw.SetDeadline(time.Now().Add(5 * time.Second)) + if err != nil { + return nil, err + } switch u.Path { case "", "/": |