You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/12/23 17:18:19 UTC

[GitHub] [pulsar-client-go] cckellogg commented on a change in pull request #428: support jwt and trusted cert for pulsar perf client

cckellogg commented on a change in pull request #428:
URL: https://github.com/apache/pulsar-client-go/pull/428#discussion_r548061983



##########
File path: perf/pulsar-perf-go.go
##########
@@ -49,6 +53,23 @@ func NewClient() (pulsar.Client, error) {
 	clientOpts := pulsar.ClientOptions{
 		URL: clientArgs.ServiceURL,
 	}
+
+	if clientArgs.TokenFile != "" {
+		// read JWT from the file
+		tokenBytes, err := ioutil.ReadFile(clientArgs.TokenFile)
+		if err != nil {
+			log.WithError(err).Errorf("failed to read Pulsar JWT from a file %s", clientArgs.TokenFile)
+			os.Exit(1)
+		}
+		clientOpts.Authentication = pulsar.NewAuthenticationToken(string(tokenBytes))
+	}
+
+	if strings.HasPrefix(clientArgs.ServiceURL, "pulsar+ssl://") {
+		if clientArgs.TLSTrustCertFile == "" {

Review comment:
       If the broker certificate is signed by a known verifier is the trust cert still needed?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org