Skip to content

Commit e6cd160

Browse files
Added log message in case sslManagerService not present.
1 parent ccb80ef commit e6cd160

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

  • kura/org.eclipse.kura.cloud.base.provider/src/main/java/org/eclipse/kura/core/data/transport/mqtt

kura/org.eclipse.kura.cloud.base.provider/src/main/java/org/eclipse/kura/core/data/transport/mqtt/MqttDataTransport.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -828,14 +828,17 @@ private MqttClientConfiguration buildConfiguration(Map<String, Object> propertie
828828
if (this.sslManagerService == null) {
829829
logger.warn("SSL Manager Service not yet initialized.");
830830
} else {
831-
if (isSSL(brokerUrl) && this.sslManagerService.isPresent()) {
832-
try {
833-
SSLSocketFactory ssf = this.sslManagerService.get().getSSLSocketFactory();
834-
835-
conOpt.setSocketFactory(ssf);
836-
} catch (Exception e) {
837-
logger.error("SSL setup failed", e);
838-
throw new IllegalStateException("SSL setup failed");
831+
if (isSSL(brokerUrl)) {
832+
if(this.sslManagerService.isPresent()) {
833+
try {
834+
SSLSocketFactory ssf = this.sslManagerService.get().getSSLSocketFactory();
835+
conOpt.setSocketFactory(ssf);
836+
} catch (Exception e) {
837+
logger.error("SSL setup failed", e);
838+
throw new IllegalStateException("SSL setup failed");
839+
}
840+
} else {
841+
logger.error("SSL Manager Service not selected.");
839842
}
840843
}
841844

0 commit comments

Comments
 (0)