本文整理汇总了Java中io.netty.handler.ssl.ClientAuth.REQUIRE属性的典型用法代码示例。如果您正苦于以下问题:Java ClientAuth.REQUIRE属性的具体用法?Java ClientAuth.REQUIRE怎么用?Java ClientAuth.REQUIRE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类io.netty.handler.ssl.ClientAuth
的用法示例。
在下文中一共展示了ClientAuth.REQUIRE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: usingNetty
static ClientHttpRequestFactory usingNetty(ClientOptions options)
throws IOException, GeneralSecurityException {
SslContext sslContext = new JdkSslContext(SSLContext.getDefault(), true, ClientAuth.REQUIRE);
final Netty4ClientHttpRequestFactory requestFactory = new Netty4ClientHttpRequestFactory();
requestFactory.setSslContext(sslContext);
if (options.getConnectionTimeout() != null) {
requestFactory.setConnectTimeout(options.getConnectionTimeout());
}
if (options.getReadTimeout() != null) {
requestFactory.setReadTimeout(options.getReadTimeout());
}
return requestFactory;
}
示例2: testNewInstanceLoader
@Test
public void testNewInstanceLoader() throws Exception {
final SslContextReloader reloader = new SslContextReloader(() -> {
return new JdkSslContext(SSLContext.getDefault(), true, ClientAuth.REQUIRE);
});
assertTrue(reloader.load());
assertEquals(ReloadState.RELOADED, reloader.getReloadState());
assertNull(reloader.getDataVersion());
}
示例3: testStaticInstanceLoader
@Test
public void testStaticInstanceLoader() throws Exception {
final JdkSslContext context = new JdkSslContext(SSLContext.getDefault(), true, ClientAuth.REQUIRE);
final SslContextReloader reloader = new SslContextReloader(() -> context);
// don't invoke load here because the constructor forces load the first time
assertEquals(ReloadState.RELOADED, reloader.getReloadState());
assertNull(reloader.getDataVersion());
assertFalse(reloader.load());
assertEquals(ReloadState.NO_CHANGE, reloader.getReloadState());
assertNull(reloader.getDataVersion());
}
示例4: isClientAuthConfigValid
@ValidationMethod(message = "must define keyManager when clientAuth is REQUIRE")
public boolean isClientAuthConfigValid() {
return clientAuth != ClientAuth.REQUIRE || keyManager != null;
}