ramanathan1504 commented on code in PR #4359:
URL: https://github.com/apache/logging-log4j2/pull/4359#discussion_r4126851028


##########
log4j-core-test/src/test/java/org/apache/logging/log4j/core/net/ssl/SslConfigurationFactoryTest.java:
##########
@@ -91,6 +92,19 @@ void testStaticConfiguration() {
         assertNotNull(sslConfiguration.getTrustStoreConfig());
     }
 
+    @Test
+    void testStoreLocationWithoutTypeUsesDefaultType() {
+        final Properties props = new Properties();
+        props.setProperty(KEYSTORE_LOCATION_PROP_NAME, 
SslKeyStoreConstants.KEYSTORE_LOCATION);

Review Comment:
   The issue reproduces with `log4j2.trustStoreLocation`. Can this test set the 
trust store location too?
   



##########
log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfigurationFactory.java:
##########
@@ -103,7 +105,8 @@ private static char[] getPassword(final String password, 
final String keyStoreTy
         // - generally use null if pass is null or ""
         // - for JKS or PKCS12 only use null if pass is null
         //   (because JKS will auto-switch to PKCS12)
-        if (keyStoreType.equals(StoreConfiguration.JKS) || 
keyStoreType.equals(StoreConfiguration.PKCS12)) {
+        if (effectiveKeyStoreType.equals(StoreConfiguration.JKS)

Review Comment:
   `KeyStore.getDefaultType()` is `pkcs12` on Java 9+. 
`AbstractKeyStoreConfiguration` already compares with `equalsIgnoreCase`.
   
   ```suggestion
           if (effectiveKeyStoreType.equalsIgnoreCase(StoreConfiguration.JKS)
                   || 
effectiveKeyStoreType.equalsIgnoreCase(StoreConfiguration.PKCS12)) {
   ```



##########
src/changelog/.2.x.x/4346_default_keystore_type.xml:
##########
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entry xmlns="https://logging.apache.org/xml/ns";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="https://logging.apache.org/xml/ns 
https://logging.apache.org/xml/ns/log4j-changelog-0.xsd";
+       type="fixed">
+  <issue id="4346" 
link="https://github.com/apache/logging-log4j2/issues/4346"/>

Review Comment:
   ```suggestion
     <issue id="4346" 
link="https://github.com/apache/logging-log4j2/issues/4346"/>
     <issue id="4359" 
link="https://github.com/apache/logging-log4j2/pull/4359"/>
   ```



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