Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARTEMIS-3081 Swap precedence of key/tr.store props #3416

Closed
wants to merge 1 commit into from

Commits on Jan 25, 2021

  1. ARTEMIS-3081 Swap precedence of key/tr.store props

    If an application wants to use a special key/truststore for Artemis but
    have the remainder of the application use the default Java store, the
    org.apache.activemq.ssl.keyStore needs to take precedence over Java's
    javax.net.ssl.keyStore. However, the current implementation takes the
    first non-null value from
      System.getProperty(JAVAX_KEYSTORE_PATH_PROP_NAME),
      System.getProperty(ACTIVEMQ_KEYSTORE_PATH_PROP_NAME),
      keyStorePath
    
    So if the default Java property is set, no override is possible. Swap
    the order of the JAVAX_... and ACTIVEMQ_... property names so that the
    ActiveMQ ones come first (as a component-specific overrides), the
    standard Java ones comes second, and finally a local attribute value
    (through Stream.of(...).firstFirst()).
    
    (In our case the application uses the default Java truststore location
    at $JAVA_HOME/lib/security/jssecacerts, and only supplies its password
    in javax.net.ssl.trustStorePassword, and then uses a dedicated
    truststore for Artemis. Defining both org.apache.activemq.ssl.trustStore
    and org.apache.activemq.ssl.trustStorePassword now makes Artemis use the
    dedicated truststore (javax.net.ssl.trustStore is not set as we use the
    default location, so the second choice
    org.apache.activemq.ssl.trustStore applies), but with the Java default
    truststore password (first choice javax.net.ssl.trustStorePassword
    applies instead of the second choice because it is set for the default
    truststore). Obviously, this does not work unless both passwords are
    identical!)
    Ingo Karkat committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    e9ac589 View commit details
    Browse the repository at this point in the history