Skip to content

Commit

Permalink
Remove ssl_required references
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovic committed Mar 23, 2018
1 parent 8cb7c18 commit fb972bd
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -71,7 +71,7 @@ The NATS server uses a [text based protocol](http://nats.io/documentation/intern
Trying 107.170.221.32...
Connected to demo.nats.io.
Escape character is '^]'.
INFO {"server_id":"JUOufISZqT09TSan4iBHCJ","version":"1.0.6","git_commit":"","go":"go1.9.4","host":"0.0.0.0","port":4222,"auth_required":false,"ssl_required":false,"tls_required":false,"tls_verify":false,"max_payload":1048576}
INFO {"server_id":"JUOufISZqT09TSan4iBHCJ","version":"1.0.6","git_commit":"","go":"go1.9.4","host":"0.0.0.0","port":4222,"auth_required":false,"tls_required":false,"tls_verify":false,"max_payload":1048576}
SUB foo 1
+OK
PUB foo 11
Expand Down
2 changes: 1 addition & 1 deletion server/client.go
Expand Up @@ -175,7 +175,7 @@ type subscription struct {
type clientOpts struct {
Verbose bool `json:"verbose"`
Pedantic bool `json:"pedantic"`
SslRequired bool `json:"ssl_required"`
TLSRequired bool `json:"tls_required"`
Authorization string `json:"auth_token"`
Username string `json:"user"`
Password string `json:"pass"`
Expand Down
8 changes: 4 additions & 4 deletions server/client_test.go
Expand Up @@ -37,7 +37,7 @@ type serverInfo struct {
Port uint `json:"port"`
Version string `json:"version"`
AuthRequired bool `json:"auth_required"`
TLSRequired bool `json:"ssl_required"`
TLSRequired bool `json:"tls_required"`
MaxPayload int64 `json:"max_payload"`
}

Expand Down Expand Up @@ -121,7 +121,7 @@ func TestClientConnect(t *testing.T) {
_, c, _ := setupClient()

// Basic Connect setting flags
connectOp := []byte("CONNECT {\"verbose\":true,\"pedantic\":true,\"ssl_required\":false}\r\n")
connectOp := []byte("CONNECT {\"verbose\":true,\"pedantic\":true,\"tls_required\":false}\r\n")
err := c.parse(connectOp)
if err != nil {
t.Fatalf("Received error: %v\n", err)
Expand Down Expand Up @@ -182,7 +182,7 @@ func TestClientConnectProto(t *testing.T) {
_, c, r := setupClient()

// Basic Connect setting flags, proto should be zero (original proto)
connectOp := []byte("CONNECT {\"verbose\":true,\"pedantic\":true,\"ssl_required\":false}\r\n")
connectOp := []byte("CONNECT {\"verbose\":true,\"pedantic\":true,\"tls_required\":false}\r\n")
err := c.parse(connectOp)
if err != nil {
t.Fatalf("Received error: %v\n", err)
Expand All @@ -195,7 +195,7 @@ func TestClientConnectProto(t *testing.T) {
}

// ProtoInfo
connectOp = []byte(fmt.Sprintf("CONNECT {\"verbose\":true,\"pedantic\":true,\"ssl_required\":false,\"protocol\":%d}\r\n", ClientProtoInfo))
connectOp = []byte(fmt.Sprintf("CONNECT {\"verbose\":true,\"pedantic\":true,\"tls_required\":false,\"protocol\":%d}\r\n", ClientProtoInfo))
err = c.parse(connectOp)
if err != nil {
t.Fatalf("Received error: %v\n", err)
Expand Down
2 changes: 1 addition & 1 deletion server/monitor_test.go
Expand Up @@ -1037,7 +1037,7 @@ func TestConcurrentMonitoring(t *testing.T) {
s := runMonitorServer()
defer s.Shutdown()

url := fmt.Sprintf("http://localhost:%d/", s.MonitorAddr().Port)
url := fmt.Sprintf("http://127.0.0.1:%d/", s.MonitorAddr().Port)
// Get some endpoints. Make sure we have at least varz,
// and the more the merrier.
endpoints := []string{"varz", "varz", "varz", "connz", "connz", "subsz", "subsz", "routez", "routez"}
Expand Down
2 changes: 1 addition & 1 deletion server/parser_test.go
Expand Up @@ -145,7 +145,7 @@ func TestParsePong(t *testing.T) {

func TestParseConnect(t *testing.T) {
c := dummyClient()
connect := []byte("CONNECT {\"verbose\":false,\"pedantic\":true,\"ssl_required\":false}\r\n")
connect := []byte("CONNECT {\"verbose\":false,\"pedantic\":true,\"tls_required\":false}\r\n")
err := c.parse(connect)
if err != nil || c.state != OP_START {
t.Fatalf("Unexpected: %d : %v\n", c.state, err)
Expand Down
1 change: 0 additions & 1 deletion server/reload.go
Expand Up @@ -245,7 +245,6 @@ func (c *clusterOption) Apply(server *Server) {
server.mu.Lock()
tlsRequired := c.newValue.TLSConfig != nil
server.routeInfo.TLSRequired = tlsRequired
server.routeInfo.SSLRequired = tlsRequired
server.routeInfo.TLSVerify = tlsRequired
server.routeInfo.AuthRequired = c.newValue.Username != ""
if c.newValue.NoAdvertise {
Expand Down
1 change: 0 additions & 1 deletion server/route.go
Expand Up @@ -674,7 +674,6 @@ func (s *Server) routeAcceptLoop(ch chan struct{}) {
Version: s.info.Version,
AuthRequired: false,
TLSRequired: tlsReq,
SSLRequired: tlsReq,
TLSVerify: tlsReq,
MaxPayload: s.info.MaxPayload,
}
Expand Down
2 changes: 0 additions & 2 deletions server/server.go
Expand Up @@ -45,7 +45,6 @@ type Info struct {
Host string `json:"host"`
Port int `json:"port"`
AuthRequired bool `json:"auth_required"`
SSLRequired bool `json:"ssl_required"` // DEPRECATED: ssl json used for older clients
TLSRequired bool `json:"tls_required"`
TLSVerify bool `json:"tls_verify"`
MaxPayload int `json:"max_payload"`
Expand Down Expand Up @@ -138,7 +137,6 @@ func New(opts *Options) *Server {
Port: opts.Port,
AuthRequired: false,
TLSRequired: tlsReq,
SSLRequired: tlsReq,
TLSVerify: verify,
MaxPayload: opts.MaxPayload,
clientConnectURLs: make(map[string]struct{}),
Expand Down
4 changes: 2 additions & 2 deletions server/split_test.go
Expand Up @@ -252,7 +252,7 @@ func TestSplitBufferPubOp5(t *testing.T) {

func TestSplitConnectArg(t *testing.T) {
c := &client{subs: make(map[string]*subscription)}
connectAll := []byte("CONNECT {\"verbose\":false,\"ssl_required\":false," +
connectAll := []byte("CONNECT {\"verbose\":false,\"tls_required\":false," +
"\"user\":\"test\",\"pedantic\":true,\"pass\":\"pass\"}\r\n")

argJSON := connectAll[8:]
Expand Down Expand Up @@ -342,7 +342,7 @@ func TestSplitDanglingArgBuf(t *testing.T) {
}

// CONNECT_ARG
connop := []byte("CONNECT {\"verbose\":false,\"ssl_required\":false," +
connop := []byte("CONNECT {\"verbose\":false,\"tls_required\":false," +
"\"user\":\"test\",\"pedantic\":true,\"pass\":\"pass\"}\r\n")
c.parse(connop[:22])
c.parse(connop[22:])
Expand Down
2 changes: 1 addition & 1 deletion test/ping_test.go
Expand Up @@ -64,7 +64,7 @@ func TestPingSentToTLSConnection(t *testing.T) {
tlsConn := c.(*tls.Conn)
tlsConn.Handshake()

cs := fmt.Sprintf("CONNECT {\"verbose\":%v,\"pedantic\":%v,\"ssl_required\":%v}\r\n", false, false, true)
cs := fmt.Sprintf("CONNECT {\"verbose\":%v,\"pedantic\":%v,\"tls_required\":%v}\r\n", false, false, true)
sendProto(t, c, cs)

expect := expectCommand(t, c)
Expand Down
2 changes: 1 addition & 1 deletion test/proto_test.go
Expand Up @@ -202,7 +202,7 @@ func TestProtoCrash(t *testing.T) {

checkInfoMsg(t, c)

send("CONNECT {\"verbose\":true,\"ssl_required\":false,\"user\":\"test\",\"pedantic\":true,\"pass\":\"password\"}")
send("CONNECT {\"verbose\":true,\"tls_required\":false,\"user\":\"test\",\"pedantic\":true,\"pass\":\"password\"}")

time.Sleep(100 * time.Millisecond)

Expand Down
4 changes: 2 additions & 2 deletions test/test.go
Expand Up @@ -173,7 +173,7 @@ func checkInfoMsg(t tLogger, c net.Conn) server.Info {

func doConnect(t tLogger, c net.Conn, verbose, pedantic, ssl bool) {
checkInfoMsg(t, c)
cs := fmt.Sprintf("CONNECT {\"verbose\":%v,\"pedantic\":%v,\"ssl_required\":%v}\r\n", verbose, pedantic, ssl)
cs := fmt.Sprintf("CONNECT {\"verbose\":%v,\"pedantic\":%v,\"tls_required\":%v}\r\n", verbose, pedantic, ssl)
sendProto(t, c, cs)
}

Expand Down Expand Up @@ -210,7 +210,7 @@ func setupConn(t tLogger, c net.Conn) (sendFun, expectFun) {

func setupConnWithProto(t tLogger, c net.Conn, proto int) (sendFun, expectFun) {
checkInfoMsg(t, c)
cs := fmt.Sprintf("CONNECT {\"verbose\":%v,\"pedantic\":%v,\"ssl_required\":%v,\"protocol\":%d}\r\n", false, false, false, proto)
cs := fmt.Sprintf("CONNECT {\"verbose\":%v,\"pedantic\":%v,\"tls_required\":%v,\"protocol\":%d}\r\n", false, false, false, proto)
sendProto(t, c, cs)
return sendCommand(t, c), expectCommand(t, c)
}
Expand Down
2 changes: 1 addition & 1 deletion test/verbose_test.go
Expand Up @@ -51,7 +51,7 @@ func TestVerboseConnect(t *testing.T) {
expect(okRe)

// Connect
send("CONNECT {\"verbose\":true,\"pedantic\":true,\"ssl_required\":false}\r\n")
send("CONNECT {\"verbose\":true,\"pedantic\":true,\"tls_required\":false}\r\n")
expect(okRe)
}

Expand Down

1 comment on commit fb972bd

@derekcollison
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Please sign in to comment.