aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-14 17:34:57 -0500
committerAdnan Maolood <[email protected]>2021-02-14 17:34:57 -0500
commit6f7c1836623e376edab9f4b28aeef47dd9830291 (patch)
tree2de1b16bf4f159a0d545bb3987215b457da056c4 /server.go
parentUpdate Client documentation (diff)
downloadgo-gemini-6f7c1836623e376edab9f4b28aeef47dd9830291.tar.xz
go-gemini-6f7c1836623e376edab9f4b28aeef47dd9830291.zip
server: Don't populate Request.Certificate field
Handlers should instead use the certificate provided in Request.TLS.
Diffstat (limited to 'server.go')
-rw-r--r--server.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/server.go b/server.go
index 7bb6e65..806ede6 100644
--- a/server.go
+++ b/server.go
@@ -230,14 +230,6 @@ func (srv *Server) respond(conn net.Conn) {
if tlsConn, ok := conn.(*tls.Conn); ok {
state := tlsConn.ConnectionState()
req.TLS = &state
- if len(req.TLS.PeerCertificates) > 0 {
- peerCert := req.TLS.PeerCertificates[0]
- // Store the TLS certificate
- req.Certificate = &tls.Certificate{
- Certificate: [][]byte{peerCert.Raw},
- Leaf: peerCert,
- }
- }
}
// Store remote address
@@ -289,7 +281,7 @@ func (srv *Server) logf(format string, args ...interface{}) {
// If ServeGemini panics, the server (the caller of ServeGemini) assumes that
// the effect of the panic was isolated to the active request. It recovers
// the panic, logs a stack trace to the server error log, and closes the
-// newtwork connection. To abort a handler so the client sees an interrupted
+// network connection. To abort a handler so the client sees an interrupted
// response but the server doesn't log an error, panic with the value
// ErrAbortHandler.
type Handler interface {