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 2022/03/22 02:57:03 UTC

[GitHub] [pulsar] nodece commented on issue #14762: Client must configure AuthenticationTls even if Authentication using TLS is not enabled

nodece commented on issue #14762:
URL: https://github.com/apache/pulsar/issues/14762#issuecomment-1074672815


   We should split the transport and auth for TLS.
   
   For transport, the code can be so like:
   ```
   PulsarClient client = PulsarClient.builder()
                   .enableTls(true)
                   .tlsTrustCertsFilePath("ca.pem")
                   .tlsCertFilePath("client-ca.pem")
                   .tlsKeyFilePath("client-key.pem")
                   .build();
   ```
   
   For auth, the code can be so like:
   ```
   Map<String, String> authParams = new HashMap<>();
   authParams.put("tlsCertFile", "client-ca.pem");
   authParams.put("tlsKeyFile", "client-key.pem");
   PulsarClient client = PulsarClient.builder()
                   .enableTls(true)
                   .tlsTrustCertsFilePath("ca.pem")
                   .authentication(AuthenticationTls.class.getName(), authParams)
                   .build();
   ```
   
   When using the TLS auth, we don't need to set `tlsCertFilePath("client-ca.pem")` and `tlsKeyFilePath("client-key.pem")`, the `authentication` instead of this.
   
   
   There have an important thing that if we are using the authentication with the token, we cannot setup the TLS transport.
   
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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