summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-08-16 10:38:45 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2017-08-16 10:38:54 -0600
commit2032d8c0f0abcb11c0bd4aa1285d57e7153fdb49 (patch)
tree14ad42a0e1c1b483f10fffc233baa6ab580ec7e9
parentc204c120177e37abf9ce089a6846fec4df7aec89 (diff)
tls-getcerts: timeout TCP R/W after 5 sec.
-rw-r--r--tls-getcerts.go5
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 "", "/":