Skip to content

Commit

Permalink
Fixed logging to trace
Browse files Browse the repository at this point in the history
  • Loading branch information
chkead committed Jan 30, 2024
1 parent bdf69a7 commit a98e309
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public PrivateKey getPrivateKey(final String alias) {
public String chooseEngineServerAlias(
final String keyType, final Principal[] issuers, final SSLEngine engine) {
final String certificateAlias = dnsResolver.resolve(engine.getPeerHost());
log.info("Choose engine server alias for host: {} found alias: {}",
log.trace("Choose engine server alias for host: {} found alias: {}",
engine.getPeerHost(),
certificateAlias);
return certificateAlias;
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/hivemq/security/ssl/SslSniHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.ssl.JdkSslServerContext;
import io.netty.handler.ssl.SniHandler;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslHandler;
Expand All @@ -46,7 +45,7 @@ public SslSniHandler(final @NotNull SslHandler sslHandler, final @NotNull SslCon
//This could be used to return a different SslContext depending on the provided hostname
//For now the same SslContext is returned independent of the provided hostname

log.info("SSLContext with input {}, cipherSuites {} and attributes {}", input, sslContext.cipherSuites(), sslContext.attributes());
log.trace("SSLContext with input {}, cipherSuites {} and attributes {}", input, sslContext.cipherSuites(), sslContext.attributes());
promise.setSuccess(sslContext);
return promise;
});
Expand All @@ -55,7 +54,7 @@ public SslSniHandler(final @NotNull SslHandler sslHandler, final @NotNull SslCon

@Override
protected Future<SslContext> lookup(ChannelHandlerContext ctx, String hostname) throws Exception {
log.info("lookup ChannelHandlerContext ctx: {} hostname: {}", ctx, hostname);
log.trace("lookup ChannelHandlerContext ctx: {} hostname: {}", ctx, hostname);
return mapping.map(hostname, ctx.executor().<SslContext>newPromise());
}

Expand All @@ -78,7 +77,7 @@ protected void replaceHandler(
SslHandler sslHandlerInstance = null;
try {
final int port = ClientConnectionContext.of(ctx.channel()).getConnectedListener().getPort();
log.info("Replace ssl handler for hostname: {} and port: {}", hostname, port);
log.trace("Replace ssl handler for hostname: {} and port: {}", hostname, port);
if (!aliasSslHandlerMap.containsKey(hostname)) {
aliasSslHandlerMap.put(hostname, sslContext.newHandler(ctx.alloc(), hostname, port));
}
Expand Down

0 comments on commit a98e309

Please sign in to comment.