Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ibmmqmet committed Jul 21, 2023
1 parent 06a6782 commit 89321ff
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ and

These JKS options are an alternative to setting the `javax.net.ssl` system properties, usually done on the command line.

An alternative preferred approach is
An alternative preferred approach for setting the key/truststores is
available from Spring 3.1, which introduced the concept of "SSL Bundles". This makes it possible to have different
SSL configurations - keystores, truststores etc - for different components executing in the same Spring-managed process.
See [here](https://spring.io/blog/2023/06/07/securing-spring-boot-applications-with-ssl)
for a description of the options available. Each bundle has an identifier with the `spring.ssl.bundle.jks.<key>` tree of options.
The key can be specified for this package with `ibm.mq.sslBundle` which will then use the Spring elements to create the
The key can be specified for this package with `ibm.mq.sslBundle` which then uses the Spring elements to create the
connection configuration. The default value for this key is empty, meaning that `SSLBundles` will not be used; the global
SSL configuration is used instead.
SSL configuration is used instead. However the `ibm.mq.jks` properties are now marked as deprecated.

| Option | Description |
| ------------------------------- | ---------------------------------------------------------------------------- |
Expand Down
6 changes: 3 additions & 3 deletions jms2.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// This file contains the versions of Spring etc to work with a javax.jms-based system
ext {
// Our shipped version - should usually match the Spring Boot Version
mqStarterVersion = '2.7.13'
mqStarterVersion = '2.7.14'

// Direct Dependencies - give versions here
springVersion = '5.3.28'
springBootVersion = '2.7.13'
springVersion = '5.3.29'
springBootVersion = '2.7.14'

// The pooledJms v2.x level is built against Java 11 so we can't move there
pooledJmsVersion = '1.2.4'
Expand Down
6 changes: 3 additions & 3 deletions jms3.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
ext {
// Our shipped version - should usually match the Spring Boot Version but
// we keep it different during the pre-GA releases
mqStarterVersion = '3.1.1'
mqStarterVersion = '3.1.2'

// Direct Dependencies - give versions here
springVersion = '6.0.10'
springBootVersion = '3.1.1'
springVersion = '6.0.11'
springBootVersion = '3.1.2'

pooledJmsVersion = '3.1.0'
jUnitVersion = '4.13.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;

/**
* This class gives a mechanism to control access to keystore/truststore JKS files
Expand All @@ -38,6 +39,7 @@ public class MQConfigurationPropertiesJks {

private Map<String, String> additionalProperties = new HashMap<String,String>();

@DeprecatedConfigurationProperty(replacement="spring.ssl.bundle")
public String getKeyStore() {
return keyStore;
}
Expand All @@ -46,6 +48,7 @@ public void setKeyStore(String keyStore) {
this.keyStore = keyStore;
}

@DeprecatedConfigurationProperty(replacement="spring.ssl.bundle")
public String getTrustStore() {
return trustStore;
}
Expand All @@ -54,6 +57,7 @@ public void setTrustStore(String trustStore) {
this.trustStore = trustStore;
}

@DeprecatedConfigurationProperty(replacement="spring.ssl.bundle")
public String getKeyStorePassword() {
return keyStorePassword;
}
Expand All @@ -62,6 +66,7 @@ public void setKeyStorePassword(String keyStorePassword) {
this.keyStorePassword = keyStorePassword;
}

@DeprecatedConfigurationProperty(replacement="spring.ssl.bundle")
public String getTrustStorePassword() {
return trustStorePassword;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public MQConfigurationSslBundles(SslBundles sslBundles) {
logger.trace("constructor - Bundles are {}", (sslBundles == null) ? "null" : "not null");
bundles = sslBundles;
}

static boolean isSupported() {
logger.trace("SSLBundles are supported");
return true;
}

/* If the bundle name does not exist, then getBundle throws an exception. Since
there is always some default bundle, we can't rely on there being no bundle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ import org.slf4j.LoggerFactory;

public class MQConfigurationSslBundles {
private static Logger logger = LoggerFactory.getLogger(MQConfigurationSslBundles.class);

static boolean isSupported() {
logger.trace("SSLBundles are not supported");
return false;
}

/* This should never actually be called */
public static SSLSocketFactory getSSLSocketFactory(String b) {
logger.trace("getSSLSocketFactory returning null for bundle {}", b);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,23 @@ public MQConnectionFactoryFactory(MQConfigurationProperties properties, List<MQC
public <T extends MQConnectionFactory> T createConnectionFactory(Class<T> factoryClass) {
String err = null;
T cf = null;
SSLSocketFactory sf = null;

String jndiProviderUrl = this.properties.getJndi().getProviderUrl();
String jndiCF = this.properties.getJndi().getProviderContextFactory();

logger.trace("createConnectionFactory for class " + factoryClass.getSimpleName());

/* Keystore System properties don't need the CF to be already created */
configureTLSStores(this.properties);
String sslBundle = this.properties.getSslBundle();

/* From Spring Boot 3.1, we can put sets of SSL configuration items in a bundle */
SSLSocketFactory sf = MQConfigurationSslBundles.getSSLSocketFactory(this.properties.getSslBundle());
/* The bundle name takes priority over the ibm.mq.jks properties */
if (MQConfigurationSslBundles.isSupported() && isNotNullOrEmpty(sslBundle)) {
sf = MQConfigurationSslBundles.getSSLSocketFactory(this.properties.getSslBundle());
} else {
configureTLSStores(this.properties);
}

if (isNotNullOrEmpty(jndiProviderUrl) && isNotNullOrEmpty(jndiCF)) {
logger.trace("createConnectionFactory using JNDI");
Expand Down
2 changes: 1 addition & 1 deletion samples/s1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'java'
apply plugin: 'org.springframework.boot'

// The designated version should match the current version in the root of the repo
ext.starterVersion = '2.7.13'
ext.starterVersion = '2.7.14'

// The local, flatDir configuration lets us use a modified version from
// this repository without needing it released via maven
Expand Down
2 changes: 1 addition & 1 deletion samples/s2.tls.jms3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'java'
apply plugin: 'org.springframework.boot'

// The designated version should match the current version in the root of the repo
ext.starterVersion = '3.1.1'
ext.starterVersion = '3.1.2'

// The local, flatDir configuration lets us use a modified version from
// this repository without needing it released via maven
Expand Down
2 changes: 1 addition & 1 deletion samples/s2.tls/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'java'
apply plugin: 'org.springframework.boot'

// The designated version should match the current version in the root of the repo
ext.starterVersion = '2.7.13'
ext.starterVersion = '2.7.14'

// The local, flatDir configuration lets us use a modified version from
// this repository without needing it released via maven
Expand Down
2 changes: 1 addition & 1 deletion samples/s2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'java'
apply plugin: 'org.springframework.boot'

// The designated version should match the current version in the root of the repo
ext.starterVersion = '2.7.13'
ext.starterVersion = '2.7.14'

// The local, flatDir configuration lets us use a modified version from
// this repository without needing it released via maven
Expand Down
2 changes: 1 addition & 1 deletion samples/s3.jms3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'java'
apply plugin: 'org.springframework.boot'

// The designated version should match the current version in the root of the repo
ext.starterVersion = '3.1.1'
ext.starterVersion = '3.1.2'


// The local, flatDir configuration lets us use a modified version from
Expand Down
2 changes: 1 addition & 1 deletion samples/s3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'java'
apply plugin: 'org.springframework.boot'

// The designated version should match the current version in the root of the repo
ext.starterVersion = '2.7.13'
ext.starterVersion = '2.7.14'

// The local, flatDir configuration lets us use a modified version from
// this repository without needing it released via maven
Expand Down

0 comments on commit 89321ff

Please sign in to comment.