Don't enforce SNI for now.
It was causing problems in development.
diff --git a/server.go b/server.go
index c719146..d47ae96 100644
--- a/server.go
+++ b/server.go
@@ -234,10 +234,16 @@
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) {