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



##########
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 certificate is from trusted certificate authorities, you can use 
the default set of certificate authorities in OS environment. But the default 
CA bundle still needs to be set against TLSTrustCertFile.
   
   I have removed the mandatory requirement of a trust file path at arg 
validation,  because Golang will spit out `failed to parse root CAs 
certificates` when root ca path is missing anyhow or any cert problem.
   
   




----------------------------------------------------------------
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:
[email protected]


Reply via email to