mirror of
https://github.com/mjl-/mox.git
synced 2024-12-28 01:13:47 +03:00
Maybe fix merge conflict?
The solution I chose was to avoid setting up a TLS connection if one was already provided to the `serve()` functions.
This commit is contained in:
parent
cd223d9e57
commit
c883e617da
2 changed files with 6 additions and 2 deletions
|
@ -52,6 +52,7 @@ import (
|
|||
"path"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"reflect"
|
||||
"runtime/debug"
|
||||
"slices"
|
||||
"sort"
|
||||
|
@ -727,7 +728,8 @@ func serve(listenerName string, cid int64, tlsConfig *tls.Config, nc net.Conn, x
|
|||
}
|
||||
}()
|
||||
|
||||
if xtls {
|
||||
isAlreadyTLS := reflect.TypeOf(nc) == reflect.TypeFor[*tls.Conn]()
|
||||
if xtls && !isAlreadyTLS {
|
||||
// Start TLS on connection. We perform the handshake explicitly, so we can set a
|
||||
// timeout, do client certificate authentication, log TLS details afterwards.
|
||||
c.xtlsHandshakeAndAuthenticate(c.conn)
|
||||
|
|
|
@ -23,6 +23,7 @@ import (
|
|||
"net"
|
||||
"net/textproto"
|
||||
"os"
|
||||
"reflect"
|
||||
"runtime/debug"
|
||||
"slices"
|
||||
"sort"
|
||||
|
@ -893,7 +894,8 @@ func serve(listenerName string, cid int64, hostname dns.Domain, tlsConfig *tls.C
|
|||
}
|
||||
}()
|
||||
|
||||
if xtls {
|
||||
isAlreadyTLS := reflect.TypeOf(nc) == reflect.TypeFor[*tls.Conn]()
|
||||
if xtls && !isAlreadyTLS {
|
||||
// Start TLS on connection. We perform the handshake explicitly, so we can set a
|
||||
// timeout, do client certificate authentication, log TLS details afterwards.
|
||||
c.xtlsHandshakeAndAuthenticate(c.conn)
|
||||
|
|
Loading…
Reference in a new issue