- // Set up keystore
- String type = AafPropsUtils.KEYSTORE_TYPE_PROPERTY;
- String store = ProvRunner.getAafPropsUtils().getKeystorePathProperty();
- String pass = ProvRunner.getAafPropsUtils().getKeystorePassProperty();
- KeyStore keyStore = readStore(store, pass, type);
- // Set up truststore
- store = ProvRunner.getAafPropsUtils().getTruststorePathProperty();
- pass = ProvRunner.getAafPropsUtils().getTruststorePassProperty();
- if (store == null || store.length() == 0) {
- store = AafPropsUtils.DEFAULT_TRUSTSTORE;
- pass = "changeit";
- }
- KeyStore trustStore = readStore(store, pass, AafPropsUtils.TRUESTSTORE_TYPE_PROPERTY);
-
- // We are connecting with the node name, but the certificate will have the CNAME
- // So we need to accept a non-matching certificate name
- SSLSocketFactory socketFactory = new SSLSocketFactory(keyStore,
+ if (Boolean.TRUE.equals(ProvRunner.getTlsEnabled())) {
+ // Set up keystore
+ String type = AafPropsUtils.KEYSTORE_TYPE_PROPERTY;
+ String store = ProvRunner.getAafPropsUtils().getKeystorePathProperty();
+ String pass = ProvRunner.getAafPropsUtils().getKeystorePassProperty();
+ KeyStore keyStore = readStore(store, pass, type);
+ // Set up truststore
+ store = ProvRunner.getAafPropsUtils().getTruststorePathProperty();
+ pass = ProvRunner.getAafPropsUtils().getTruststorePassProperty();
+ KeyStore trustStore = readStore(store, pass, AafPropsUtils.TRUESTSTORE_TYPE_PROPERTY);
+
+ // We are connecting with the node name, but the certificate will have the CNAME
+ // So we need to accept a non-matching certificate name
+ SSLSocketFactory socketFactory = new SSLSocketFactory(keyStore,