Skip to content

Commit

Permalink
Don't require TLS for in-process connection
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Twigg <neil@nats.io>
  • Loading branch information
neilalexander committed Jul 19, 2023
1 parent 80fb29f commit e9aa7ed
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions server/server.go
Expand Up @@ -2217,7 +2217,7 @@ func (s *Server) AcceptLoop(clr chan struct{}) {
func (s *Server) InProcessConn() (net.Conn, error) {
pl, pr := net.Pipe()
if !s.startGoRoutine(func() {
s.createClient(pl)
s.createClientInProcess(pl)
s.grWG.Done()
}) {
pl.Close()
Expand Down Expand Up @@ -2572,6 +2572,14 @@ func (c *tlsMixConn) Read(b []byte) (int, error) {
}

func (s *Server) createClient(conn net.Conn) *client {
return s.createClientEx(conn, false)
}

func (s *Server) createClientInProcess(conn net.Conn) *client {
return s.createClientEx(conn, true)
}

func (s *Server) createClientEx(conn net.Conn, inProcess bool) *client {
// Snapshot server options.
opts := s.getOpts()

Expand Down Expand Up @@ -2659,7 +2667,7 @@ func (s *Server) createClient(conn net.Conn) *client {
}
s.clients[c.cid] = c

tlsRequired := info.TLSRequired
tlsRequired := info.TLSRequired && !inProcess
s.mu.Unlock()

// Re-Grab lock
Expand Down

0 comments on commit e9aa7ed

Please sign in to comment.