Browse Source

Don't enforce SNI for now.

It was causing problems in development.
Brad Fitzpatrick 11 years ago
parent
commit
f0f7876b26
1 changed files with 9 additions and 3 deletions
  1. 9 3
      server.go

+ 9 - 3
server.go

@@ -234,10 +234,16 @@ func (srv *Server) handleConn(hs *http.Server, c net.Conn, h http.Handler) {
 			return
 		}
 
-		// Client must use SNI:
 		if sc.tlsState.ServerName == "" {
-			sc.rejectConn(ErrCodeProtocol, "client didn't use SNI")
-			return
+			// Client must use SNI, but we don't enforce that anymore,
+			// since it was causing problems when connecting to bare IP
+			// addresses during development.
+			//
+			// TODO: optionally enforce? Or enforce at the time we receive
+			// a new request, and verify the the ServerName matches the :authority?
+			// But that precludes proxy situations, perhaps.
+			//
+			// So for now, do nothing here again.
 		}
 
 		if isBadCipher(sc.tlsState.CipherSuite) {