Skip to content

Commit

Permalink
fix(upload-notes): fixed rabbit connection
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoSkorJjj committed Apr 23, 2024
1 parent 9549b82 commit 5465f6a
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ public CachingConnectionFactory connectionFactory() {
factory.setPort(Integer.parseInt(env.getProperty("spring.rabbitmq.port")));
factory.setUsername(env.getProperty("spring.rabbitmq.username"));
factory.setPassword(env.getProperty("spring.rabbitmq.password"));
boolean sslEnabled = Boolean.parseBoolean(env.getProperty("spring.rabbitmq.ssl.enabled"));
if (sslEnabled) {
try {
// SSLContext sslContext = SSLContext.getInstance(env.getProperty("spring.rabbitmq.ssl.algorithm"));
// sslContext.init(null, null, new SecureRandom());
factory.getRabbitConnectionFactory().useSslProtocol((String) null);
} catch (Exception e) {
logger.error("Failed to set up SSL context", e);
throw new RuntimeException("Failed to set up SSL context", e);
}
}
// boolean sslEnabled = Boolean.parseBoolean(env.getProperty("spring.rabbitmq.ssl.enabled"));
// if (sslEnabled) {
// try {
// // SSLContext sslContext = SSLContext.getInstance(env.getProperty("spring.rabbitmq.ssl.algorithm"));
// // sslContext.init(null, null, new SecureRandom());
// factory.getRabbitConnectionFactory().useSslProtocol((String) null);
// } catch (Exception e) {
// logger.error("Failed to set up SSL context", e);
// throw new RuntimeException("Failed to set up SSL context", e);
// }
// }
return factory;
}

Expand Down

0 comments on commit 5465f6a

Please sign in to comment.