mySetupClientHostnameValidation() — netty Function Reference
Architecture documentation for the mySetupClientHostnameValidation() function in SSLEngineTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD a47c51db_784f_37ec_acb1_136f0f6d6b46["mySetupClientHostnameValidation()"] 9150c92a_2afc_b83a_c3bf_86dfac6e9d9b["SSLEngineTest"] a47c51db_784f_37ec_acb1_136f0f6d6b46 -->|defined in| 9150c92a_2afc_b83a_c3bf_86dfac6e9d9b b072d43b_c5e1_e4aa_f3ac_f9614a8cd24f["testClientHostnameValidationSuccess()"] b072d43b_c5e1_e4aa_f3ac_f9614a8cd24f -->|calls| a47c51db_784f_37ec_acb1_136f0f6d6b46 56ebabc3_e8f7_1b64_cbbb_5c38613bb1d8["testClientHostnameValidationFail()"] 56ebabc3_e8f7_1b64_cbbb_5c38613bb1d8 -->|calls| a47c51db_784f_37ec_acb1_136f0f6d6b46 bf19737b_7dc7_9dfd_0a67_ae31448ebbe8["protocols()"] a47c51db_784f_37ec_acb1_136f0f6d6b46 -->|calls| bf19737b_7dc7_9dfd_0a67_ae31448ebbe8 e3b541e6_b593_4b1f_a637_da19020e73df["ciphers()"] a47c51db_784f_37ec_acb1_136f0f6d6b46 -->|calls| e3b541e6_b593_4b1f_a637_da19020e73df d074ce38_190b_dae8_46f6_82b7c5e7ecaf["TestByteBufAllocator()"] a47c51db_784f_37ec_acb1_136f0f6d6b46 -->|calls| d074ce38_190b_dae8_46f6_82b7c5e7ecaf e3264542_e539_15fe_6edf_a60fa8537434["MessageDelegatorChannelHandler()"] a47c51db_784f_37ec_acb1_136f0f6d6b46 -->|calls| e3264542_e539_15fe_6edf_a60fa8537434 style a47c51db_784f_37ec_acb1_136f0f6d6b46 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java lines 993–1136
private Future<Void> mySetupClientHostnameValidation(final SSLEngineTestParam param, File serverCrtFile,
File serverKeyFile,
File clientTrustCrtFile,
final boolean failureExpected)
throws SSLException, InterruptedException {
final String expectedHost = "localhost";
serverSslCtx = wrapContext(param, SslContextBuilder.forServer(serverCrtFile, serverKeyFile, null)
.sslProvider(sslServerProvider())
.protocols(param.protocols())
.ciphers(param.ciphers())
.sslContextProvider(serverSslContextProvider())
.trustManager(InsecureTrustManagerFactory.INSTANCE)
.ciphers(null, IdentityCipherSuiteFilter.INSTANCE)
.sessionCacheSize(0)
.sessionTimeout(0)
.build());
clientSslCtx = wrapContext(param, SslContextBuilder.forClient()
.sslProvider(sslClientProvider())
.protocols(param.protocols())
.ciphers(param.ciphers())
.sslContextProvider(clientSslContextProvider())
.trustManager(clientTrustCrtFile)
.ciphers(null, IdentityCipherSuiteFilter.INSTANCE)
.sessionCacheSize(0)
.sessionTimeout(0)
.build());
serverConnectedChannel = null;
sb = new ServerBootstrap();
cb = new Bootstrap();
sb.group(new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()));
sb.channel(NioServerSocketChannel.class);
sb.childHandler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
ch.config().setAllocator(new TestByteBufAllocator(ch.config().getAllocator(), param.type));
ChannelPipeline p = ch.pipeline();
SslHandler handler = !param.delegate ? serverSslCtx.newHandler(ch.alloc()) :
serverSslCtx.newHandler(ch.alloc(), delegatingExecutor);
p.addLast(handler);
p.addLast(new MessageDelegatorChannelHandler(serverReceiver, serverLatch));
p.addLast(new ChannelInboundHandlerAdapter() {
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt == SslHandshakeCompletionEvent.SUCCESS) {
if (failureExpected) {
serverException = new IllegalStateException("handshake complete. expected failure");
}
serverLatch.countDown();
} else if (evt instanceof SslHandshakeCompletionEvent) {
serverException = ((SslHandshakeCompletionEvent) evt).cause();
serverLatch.countDown();
}
ctx.fireUserEventTriggered(evt);
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (cause.getCause() instanceof SSLHandshakeException) {
serverException = cause.getCause();
serverLatch.countDown();
} else {
serverException = cause;
ctx.fireExceptionCaught(cause);
}
}
});
serverConnectedChannel = ch;
}
});
final Promise<Void> clientWritePromise = ImmediateEventExecutor.INSTANCE.newPromise();
cb.group(new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()));
cb.channel(NioSocketChannel.class);
cb.handler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
ch.config().setAllocator(new TestByteBufAllocator(ch.config().getAllocator(), param.type));
Domain
Subdomains
Source
Frequently Asked Questions
What does mySetupClientHostnameValidation() do?
mySetupClientHostnameValidation() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java.
Where is mySetupClientHostnameValidation() defined?
mySetupClientHostnameValidation() is defined in handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java at line 993.
What does mySetupClientHostnameValidation() call?
mySetupClientHostnameValidation() calls 4 function(s): MessageDelegatorChannelHandler, TestByteBufAllocator, ciphers, protocols.
What calls mySetupClientHostnameValidation()?
mySetupClientHostnameValidation() is called by 2 function(s): testClientHostnameValidationFail, testClientHostnameValidationSuccess.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free