aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-08 12:32:47 -0500
committerAdnan Maolood <[email protected]>2021-02-08 12:32:49 -0500
commit29f2b3738d14b01f3902d6d06a672c8347954d7b (patch)
treec348c4fb874103ff2a303801872c2e62228206a2 /server.go
parentRemove unused field (diff)
downloadgo-gemini-29f2b3738d14b01f3902d6d06a672c8347954d7b.tar.xz
go-gemini-29f2b3738d14b01f3902d6d06a672c8347954d7b.zip
Make TLS field nil for unencrypted connections
Diffstat (limited to 'server.go')
-rw-r--r--server.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/server.go b/server.go
index 523cb39..5c8e8e3 100644
--- a/server.go
+++ b/server.go
@@ -207,7 +207,8 @@ func (s *Server) respond(conn net.Conn) {
// Store information about the TLS connection
if tlsConn, ok := conn.(*tls.Conn); ok {
- req.TLS = tlsConn.ConnectionState()
+ state := tlsConn.ConnectionState()
+ req.TLS = &state
if len(req.TLS.PeerCertificates) > 0 {
peerCert := req.TLS.PeerCertificates[0]
// Store the TLS certificate