(t *testing.T)
| 524 | } |
| 525 | |
| 526 | func TestServerTLSHintConnections(t *testing.T) { |
| 527 | s, opts := RunServerWithConfig("./configs/tls.conf") |
| 528 | defer s.Shutdown() |
| 529 | |
| 530 | endpoint := fmt.Sprintf("%s:%d", opts.Host, opts.Port) |
| 531 | secureURL := fmt.Sprintf("tls://%s:%s@%s/", opts.Username, opts.Password, endpoint) |
| 532 | |
| 533 | nc, err := nats.Connect(secureURL, nats.RootCAs("./configs/certs/badca.pem")) |
| 534 | if err == nil { |
| 535 | nc.Close() |
| 536 | t.Fatal("Expected an error from bad RootCA file") |
| 537 | } |
| 538 | |
| 539 | nc, err = nats.Connect(secureURL, nats.RootCAs("./configs/certs/ca.pem")) |
| 540 | if err != nil { |
| 541 | t.Fatalf("Failed to create secure (TLS) connection: %v", err) |
| 542 | } |
| 543 | defer nc.Close() |
| 544 | } |
| 545 | |
| 546 | func TestClosedConnections(t *testing.T) { |
| 547 | s := RunDefaultServer() |
nothing calls this directly
no test coverage detected