You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2022/01/17 13:40:15 UTC

[GitHub] [activemq-artemis] gemmellr commented on a change in pull request #3915: NO-JIRA Fix activemq5-unit-tests with SSL

gemmellr commented on a change in pull request #3915:
URL: https://github.com/apache/activemq-artemis/pull/3915#discussion_r786009674



##########
File path: tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java
##########
@@ -796,9 +796,19 @@ public ConnectorInfo(URI bindAddress, SpringSslContext context) throws URISyntax
             //it means the uri is already configured ssl
             uri = new URI("tcp", bindAddress.getUserInfo(), host, port, bindAddress.getPath(), bindAddress.getQuery(), bindAddress.getFragment());
          } else {
-            String baseUri = "tcp://" + host + ":" + port + "?" + TransportConstants.SSL_ENABLED_PROP_NAME + "=true&" + TransportConstants.KEYSTORE_PATH_PROP_NAME + "=" + (context == null ? defaultKeyStore : context.getKeyStore()) + "&" + TransportConstants.KEYSTORE_PASSWORD_PROP_NAME + "=" + (context == null ? defaultKeyStorePassword : context.getKeyStorePassword()) + "&" + TransportConstants.KEYSTORE_PROVIDER_PROP_NAME + "=" + (context == null ? defaultKeyStoreType : context.getKeyStoreType());
+            String keyStoreType = context == null ? defaultKeyStoreType : context.getKeyStoreType();
+            if (keyStoreType.equals("jks")) {
+               keyStoreType = "JKS";
+            }
+
+            String baseUri = "tcp://" + host + ":" + port + "?" + TransportConstants.SSL_ENABLED_PROP_NAME + "=true&" + TransportConstants.KEYSTORE_PATH_PROP_NAME + "=" + (context == null ? defaultKeyStore : context.getKeyStore()) + "&" + TransportConstants.KEYSTORE_PASSWORD_PROP_NAME + "=" + (context == null ? defaultKeyStorePassword : context.getKeyStorePassword()) + "&" + TransportConstants.KEYSTORE_PROVIDER_PROP_NAME + "=" + keyStoreType;

Review comment:
       This appears to be jumping hoops to manage case for the value of 'key store type', and then using it to set the 'provider type' config property, which is actually for something else entirely. (Presumably the original bit being changed was prior to 186481bbe8e79274eb009f63052b1d0528d0249d)
   
   Would it not be better to change it to just stop setting the provider property at all and use the keystore type config property?




-- 
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: gitbox-unsubscribe@activemq.apache.org

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