summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-08-12 08:48:10 -0600
committertjpcc <tjp@ctrl-c.club>2023-08-12 08:48:10 -0600
commitb423ed96c71bdd1cdecc4129a26d2dbcaa91dafe (patch)
tree5927cc693b2f94d4189e6eb82d076286141dbb00
parent330b6e4828d59a6d5fae3cc7a30e6fda0856577b (diff)
avoid copying a tls.Config
Fixes #5
-rw-r--r--gemini/client.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/gemini/client.go b/gemini/client.go
index 338271c..b677483 100644
--- a/gemini/client.go
+++ b/gemini/client.go
@@ -52,12 +52,12 @@ func (client Client) RoundTrip(request *sr.Request) (*sr.Response, error) {
host = net.JoinHostPort(host, "1965")
}
- tlsConf := tls.Config{InsecureSkipVerify: true}
- if (client.tlsConf != nil) {
- tlsConf = *client.tlsConf
+ tlsConf := client.tlsConf
+ if (tlsConf == nil) {
+ tlsConf = &tls.Config{InsecureSkipVerify: true}
}
- conn, err := tls.Dial("tcp", host, &tlsConf)
+ conn, err := tls.Dial("tcp", host, tlsConf)
if err != nil {
return nil, err
}