michaeljmarshall commented on code in PR #19483:
URL: https://github.com/apache/pulsar/pull/19483#discussion_r1108080964


##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/keystoretls/KeyStoreSSLContext.java:
##########
@@ -159,8 +159,10 @@ public SSLContext createSSLContext() throws 
GeneralSecurityException, IOExceptio
                     : TrustManagerFactory.getInstance(tmfAlgorithm);
             KeyStore trustStore = KeyStore.getInstance(trustStoreTypeString);
             char[] passwordChars = trustStorePassword.toCharArray();
-            try (FileInputStream inputStream = new 
FileInputStream(trustStorePath)) {
-                trustStore.load(inputStream, passwordChars);
+            if (!Strings.isNullOrEmpty(trustStorePath)) {

Review Comment:
   For reference, calling `trustManagerFactory.init(null)`, calls: 
   
   ```
       public final void init(KeyStore ks) throws KeyStoreException {
           factorySpi.engineInit(ks);
       }
   ```
   
   And that calls the following in conscrypt:
   
   ```
       @Override
       public void engineInit(KeyStore ks) throws KeyStoreException {
           if (ks != null) {
               keyStore = ks;
           } else {
               keyStore = Platform.getDefaultCertKeyStore();
           }
       }
   ```
   
   
https://github.com/google/conscrypt/blob/ca6485b689219323e91d3bbe0410715b5b2d687f/common/src/main/java/org/conscrypt/TrustManagerFactoryImpl.java#L55-L65
   
   That is why I suggested using `null` as the `KeyStore`. I haven't found 
documentation to suggest that this is the general implementation though.



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to