From b423ed96c71bdd1cdecc4129a26d2dbcaa91dafe Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 12 Aug 2023 08:48:10 -0600 Subject: avoid copying a tls.Config Fixes #5 --- gemini/client.go | 8 ++++---- 1 file 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 } -- cgit v1.2.3