diff options
| author | Adnan Maolood <[email protected]> | 2021-02-08 12:32:47 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-02-08 12:32:49 -0500 |
| commit | 29f2b3738d14b01f3902d6d06a672c8347954d7b (patch) | |
| tree | c348c4fb874103ff2a303801872c2e62228206a2 /server.go | |
| parent | Remove unused field (diff) | |
| download | go-gemini-29f2b3738d14b01f3902d6d06a672c8347954d7b.tar.xz go-gemini-29f2b3738d14b01f3902d6d06a672c8347954d7b.zip | |
Make TLS field nil for unencrypted connections
Diffstat (limited to 'server.go')
| -rw-r--r-- | server.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |