Skip to content

Commit

Permalink
naming: tlsrootca -> tlscacert
Browse files Browse the repository at this point in the history
  • Loading branch information
menaptm committed Dec 4, 2020
1 parent 4d47505 commit 7dcfa15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions examples/nats-pub/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
// nats-pub -s demo.nats.io:4443 <subject> <msg> (TLS version)

func usage() {
log.Printf("Usage: nats-pub [-s server] [-creds file] [-tlscert file] [-tlskey file] [-tlsrootca file] <subject> <msg>\n")
log.Printf("Usage: nats-pub [-s server] [-creds file] [-tlscert file] [-tlskey file] [-tlscacert file] <subject> <msg>\n")
flag.PrintDefaults()
}

Expand All @@ -40,7 +40,7 @@ func main() {
var userCreds = flag.String("creds", "", "User Credentials File")
var tlsClientCert = flag.String("tlscert", "", "TLS client certificate file")
var tlsClientKey = flag.String("tlskey", "", "Private key file for client certificate")
var tlsRootCA = flag.String("tlsrootca", "", "Root CA file for server verification")
var tlsCACert = flag.String("tlscacert", "", "CA certificate to verify peer against")
var reply = flag.String("reply", "", "Sets a specific reply subject")
var showHelp = flag.Bool("h", false, "Show help message")

Expand Down Expand Up @@ -70,9 +70,9 @@ func main() {
opts = append(opts, nats.ClientCert(*tlsClientCert, *tlsClientKey))
}

// Use specific root certificate
if *tlsRootCA != "" {
opts = append(opts, nats.RootCAs(*tlsRootCA))
// Use specific CA certificate
if *tlsCACert != "" {
opts = append(opts, nats.RootCAs(*tlsCACert))
}

// Connect to NATS
Expand Down
10 changes: 5 additions & 5 deletions examples/nats-sub/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
// nats-sub -s demo.nats.io:4443 <subject> (TLS version)

func usage() {
log.Printf("Usage: nats-sub [-s server] [-creds file] [-tlscert file] [-tlskey file] [-tlsrootca file] [-t] <subject>\n")
log.Printf("Usage: nats-sub [-s server] [-creds file] [-tlscert file] [-tlskey file] [-tlscacert file] [-t] <subject>\n")
flag.PrintDefaults()
}

Expand All @@ -46,7 +46,7 @@ func main() {
var userCreds = flag.String("creds", "", "User Credentials File")
var tlsClientCert = flag.String("tlscert", "", "TLS client certificate file")
var tlsClientKey = flag.String("tlskey", "", "Private key file for client certificate")
var tlsRootCA = flag.String("tlsrootca", "", "Root CA file for server verification")
var tlsCACert = flag.String("tlscacert", "", "CA certificate to verify peer against")
var showTime = flag.Bool("t", false, "Display timestamps")
var showHelp = flag.Bool("h", false, "Show help message")

Expand Down Expand Up @@ -77,9 +77,9 @@ func main() {
opts = append(opts, nats.ClientCert(*tlsClientCert, *tlsClientKey))
}

// Use specific root certificate
if *tlsRootCA != "" {
opts = append(opts, nats.RootCAs(*tlsRootCA))
// Use specific CA certificate
if *tlsCACert != "" {
opts = append(opts, nats.RootCAs(*tlsCACert))
}

// Connect to NATS
Expand Down

0 comments on commit 7dcfa15

Please sign in to comment.