fix a nil reference issue in tls listener

pull/432/head v2.18.2
Darien Raymond 2017-02-17 10:33:42 +01:00
parent 7d2e2baaf9
commit 949a74edfa
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 3 additions and 2 deletions

View File

@ -107,12 +107,13 @@ func (v *TCPListener) KeepAccepting() {
v.Unlock()
break
}
if v.tlsConfig != nil {
if conn != nil && v.tlsConfig != nil {
conn = tls.Server(conn, v.tlsConfig)
}
if v.authConfig != nil {
if conn != nil && v.authConfig != nil {
conn = v.authConfig.Server(conn)
}
select {
case v.awaitingConns <- &ConnectionWithError{
conn: conn,