本文整理汇总了Java中org.xnio.SslClientAuthMode类的典型用法代码示例。如果您正苦于以下问题:Java SslClientAuthMode类的具体用法?Java SslClientAuthMode怎么用?Java SslClientAuthMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SslClientAuthMode类属于org.xnio包,在下文中一共展示了SslClientAuthMode类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPeerCertificates
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
@Override
public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException, RenegotiationRequiredException {
try {
return channel.getSslSession().getPeerCertificates();
} catch (SSLPeerUnverifiedException e) {
try {
SslClientAuthMode sslClientAuthMode = channel.getOption(Options.SSL_CLIENT_AUTH_MODE);
if (sslClientAuthMode == SslClientAuthMode.NOT_REQUESTED) {
throw new RenegotiationRequiredException();
}
} catch (IOException e1) {
//ignore, will not actually happen
}
throw e;
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:SpdySslSessionInfo.java
示例2: getPeerCertificateChain
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
@Override
public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException, RenegotiationRequiredException {
try {
return channel.getSslSession().getPeerCertificateChain();
} catch (SSLPeerUnverifiedException e) {
try {
SslClientAuthMode sslClientAuthMode = channel.getOption(Options.SSL_CLIENT_AUTH_MODE);
if (sslClientAuthMode == SslClientAuthMode.NOT_REQUESTED) {
throw new RenegotiationRequiredException();
}
} catch (IOException e1) {
//ignore, will not actually happen
}
throw e;
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:SpdySslSessionInfo.java
示例3: create
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
private static ManagementHttpServer create(Builder builder) {
SSLContext sslContext = null;
SslClientAuthMode sslClientAuthMode = builder.sslClientAuthMode;
if (builder.secureBindAddress != null) {
sslContext = getSSLContext(builder);
if (sslContext == null) {
throw ROOT_LOGGER.sslRequestedNoSslContext();
}
}
HttpOpenListener openListener = new HttpOpenListener(new ByteBufferSlicePool(BufferAllocator.DIRECT_BYTE_BUFFER_ALLOCATOR, 4096, 10 * 4096));
int secureRedirectPort = builder.secureBindAddress != null ? builder.secureBindAddress.getPort() : -1;
// WFLY-2870 -- redirect not supported if bindAddress and secureBindAddress are using different InetAddress
boolean redirectSupported = (builder.bindAddress == null || builder.secureBindAddress == null || builder.bindAddress.getAddress().equals(builder.secureBindAddress.getAddress()));
if (!redirectSupported && secureRedirectPort > 0) {
HttpServerLogger.ROOT_LOGGER.httpsRedirectNotSupported(builder.bindAddress.getAddress(), builder.secureBindAddress.getAddress());
secureRedirectPort = -1;
}
final ExtensionHandlers extensionHandlers = setupOpenListener(openListener, secureRedirectPort, builder);
return new ManagementHttpServer(openListener, builder.bindAddress, builder.secureBindAddress, sslContext, sslClientAuthMode, builder.worker, extensionHandlers);
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:24,代码来源:ManagementHttpServer.java
示例4: renegotiate
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
@Override
public void renegotiate(HttpServerExchange exchange, SslClientAuthMode sslClientAuthMode) throws IOException {
if (exchange.isRequestComplete()) {
renegotiateNoRequest(exchange, sslClientAuthMode);
} else {
renegotiateBufferRequest(exchange, sslClientAuthMode);
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:ConnectionSSLSessionInfo.java
示例5: renegotiateNoRequest
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
public void renegotiateNoRequest(HttpServerExchange exchange, SslClientAuthMode newAuthMode) throws IOException {
AbstractServerConnection.ConduitState oldState = serverConnection.resetChannel();
try {
SslClientAuthMode sslClientAuthMode = channel.getOption(Options.SSL_CLIENT_AUTH_MODE);
if (sslClientAuthMode == SslClientAuthMode.NOT_REQUESTED) {
SslHandshakeWaiter waiter = new SslHandshakeWaiter();
channel.getHandshakeSetter().set(waiter);
//we use requested, to place nicely with other auth modes
channel.setOption(Options.SSL_CLIENT_AUTH_MODE, newAuthMode);
channel.getSslSession().invalidate();
channel.startHandshake();
ByteBuffer buff = ByteBuffer.wrap(new byte[1]);
while (!waiter.isDone() && serverConnection.isOpen()) {
int read = serverConnection.getSourceChannel().read(buff);
if (read != 0) {
throw new SSLPeerUnverifiedException("");
}
if (!waiter.isDone()) {
serverConnection.getSourceChannel().awaitReadable();
}
}
}
} finally {
if (oldState != null) {
serverConnection.restoreChannel(oldState);
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:ConnectionSSLSessionInfo.java
示例6: getSslClientAuthMode
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
private SslClientAuthMode getSslClientAuthMode(Ssl ssl) {
if (ssl.getClientAuth() == ClientAuth.NEED) {
return SslClientAuthMode.REQUIRED;
}
if (ssl.getClientAuth() == ClientAuth.WANT) {
return SslClientAuthMode.REQUESTED;
}
return SslClientAuthMode.NOT_REQUESTED;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:UndertowEmbeddedServletContainerFactory.java
示例7: ManagementHttpServer
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
private ManagementHttpServer(HttpOpenListener openListener, InetSocketAddress httpAddress, InetSocketAddress secureAddress, SSLContext sslContext,
SslClientAuthMode sslClientAuthMode, XnioWorker worker, ExtensionHandlers extensionExtensionHandlers) {
this.openListener = openListener;
this.httpAddress = httpAddress;
this.secureAddress = secureAddress;
this.sslContext = sslContext;
this.sslClientAuthMode = sslClientAuthMode;
this.worker = worker;
this.extensionHandlers = extensionExtensionHandlers;
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:11,代码来源:ManagementHttpServer.java
示例8: getSslClientAuthMode
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
private static SslClientAuthMode getSslClientAuthMode(final SecurityRealm securityRealm) {
Set<AuthMechanism> supportedMechanisms = securityRealm.getSupportedAuthenticationMechanisms();
if (supportedMechanisms.contains(AuthMechanism.CLIENT_CERT)) {
if (supportedMechanisms.contains(AuthMechanism.DIGEST)
|| supportedMechanisms.contains(AuthMechanism.PLAIN)) {
// Username / Password auth is possible so don't mandate a client certificate.
return SslClientAuthMode.REQUESTED;
} else {
return SslClientAuthMode.REQUIRED;
}
}
return null;
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:15,代码来源:UndertowHttpManagementService.java
示例9: renegotiate
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
@Override
public void renegotiate(HttpServerExchange exchange, SslClientAuthMode sslClientAuthMode) throws IOException {
throw UndertowMessages.MESSAGES.renegotiationNotSupported();
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SpdySslSessionInfo.java
示例10: setSSLClientAuthMode
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
/**
* Set the SSL client authentication mode.
*
* Note: This should only be used for {@link SecurityRealm} provided {@link SSLContext} instances.
*
* @param sslClientAuthMode the SSL client authentication mode.
* @return {@code this} to allow chaining of commands.
*/
public Builder setSSLClientAuthMode(SslClientAuthMode sslClientAuthMode) {
assertNotBuilt();
this.sslClientAuthMode = sslClientAuthMode;
return this;
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:15,代码来源:ManagementHttpServer.java
示例11: renegotiate
import org.xnio.SslClientAuthMode; //导入依赖的package包/类
/**
* Renegotiate in a blocking manner. This will set the client aut
*
* TODO: we also need a non-blocking version
*
* @throws IOException
* @param exchange The exchange
* @param sslClientAuthMode The client cert mode to use when renegotiating
*/
void renegotiate(HttpServerExchange exchange, SslClientAuthMode sslClientAuthMode) throws IOException;
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:SSLSessionInfo.java
注:本文中的org.xnio.SslClientAuthMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论