Skip to content

Commit

Permalink
fix broker startup if ssl is enabled (mqtts/https/wss)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytro-landiak committed Mar 26, 2024
1 parent e093e82 commit aa42ad9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.thingsboard.mqtt.broker.server.AbstractMqttHandlerProvider;
import org.thingsboard.mqtt.broker.ssl.config.SslCredentials;
Expand All @@ -42,6 +43,7 @@ public SslCredentialsConfig mqttSslCredentials() {
}

@Autowired(required = false)
@Lazy
@Qualifier("mqttSslCredentials")
private SslCredentialsConfig mqttSslCredentialsConfig;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.thingsboard.mqtt.broker.server.AbstractMqttHandlerProvider;
import org.thingsboard.mqtt.broker.ssl.config.SslCredentials;
Expand All @@ -42,8 +43,9 @@ public SslCredentialsConfig mqttWssCredentials() {
}

@Autowired(required = false)
@Lazy
@Qualifier("mqttWssCredentials")
private SslCredentialsConfig mqttSslCredentialsConfig;
private SslCredentialsConfig mqttWssCredentialsConfig;

@Override
protected String getSslProtocol() {
Expand All @@ -52,7 +54,7 @@ protected String getSslProtocol() {

@Override
protected SslCredentials getSslCredentials() {
return this.mqttSslCredentialsConfig.getCredentials();
return this.mqttWssCredentialsConfig.getCredentials();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.thingsboard.mqtt.broker.ssl.config.SslCredentials;
import org.thingsboard.mqtt.broker.ssl.config.SslCredentialsConfig;
Expand All @@ -42,6 +43,7 @@ public SslCredentialsConfig httpServerSslCredentials() {
}

@Autowired
@Lazy
@Qualifier("httpServerSslCredentials")
private SslCredentialsConfig httpServerSslCredentialsConfig;

Expand Down

0 comments on commit aa42ad9

Please sign in to comment.