本文整理了Java中io.netty.handler.ssl.SslContext.newEngine()
方法的一些代码示例,展示了SslContext.newEngine()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SslContext.newEngine()
方法的具体详情如下:
包路径:io.netty.handler.ssl.SslContext
类名称:SslContext
方法名:newEngine
[英]Creates a new SSLEngine.
If SslProvider#OPENSSL_REFCNT is used then the object must be released. One way to do this is to wrap in a SslHandler and insert it into a pipeline. See #newHandler(ByteBufAllocator).
[中]创建一个新的SSLEngine。
如果使用SslProvider#OPENSSL_REFCNT,则必须释放该对象。实现这一点的一种方法是用SslHandler包装并将其插入管道中。请参阅#newHandler(ByteBufAllocator)。
代码示例来源:origin: wildfly/wildfly
@Override
public SSLEngine run() {
if (verifyHost) {
return context.newEngine(alloc, sniHost != null ? sniHost : host, port);
} else {
return context.newEngine(alloc);
}
}
});
代码示例来源:origin: eclipse-vertx/vert.x
public SSLEngine createEngine(SslContext sslContext) {
SSLEngine engine = sslContext.newEngine(ByteBufAllocator.DEFAULT);
configureEngine(engine, null);
return engine;
}
代码示例来源:origin: redisson/redisson
/**
* Create a new SslHandler.
* @see #newHandler(ByteBufAllocator)
*/
protected SslHandler newHandler(ByteBufAllocator alloc, boolean startTls) {
return new SslHandler(newEngine(alloc), startTls);
}
代码示例来源:origin: redisson/redisson
@Override
public final SSLEngine newEngine(ByteBufAllocator alloc) {
SSLEngine engine = ctx.newEngine(alloc);
initEngine(engine);
return engine;
}
代码示例来源:origin: redisson/redisson
/**
* Create a new SslHandler.
* @see #newHandler(ByteBufAllocator, String, int, boolean)
*/
protected SslHandler newHandler(ByteBufAllocator alloc, String peerHost, int peerPort, boolean startTls) {
return new SslHandler(newEngine(alloc, peerHost, peerPort), startTls);
}
代码示例来源:origin: redisson/redisson
@Override
public final SSLEngine newEngine(ByteBufAllocator alloc, String peerHost, int peerPort) {
SSLEngine engine = ctx.newEngine(alloc, peerHost, peerPort);
initEngine(engine);
return engine;
}
代码示例来源:origin: neo4j/neo4j
private SslHandler createSslHandler( ChannelHandlerContext ctx, InetSocketAddress inetSocketAddress )
{
SSLEngine sslEngine = sslContext.newEngine( ctx.alloc(), inetSocketAddress.getHostName(), inetSocketAddress.getPort() );
for ( Function<SSLEngine,SSLEngine> mod : engineModifications )
{
sslEngine = mod.apply( sslEngine );
}
// Don't need to set tls versions since that is set up from the context
return new SslHandler( sslEngine );
}
代码示例来源:origin: wildfly/wildfly
/**
* Create a new SslHandler.
* @see #newHandler(ByteBufAllocator)
*/
protected SslHandler newHandler(ByteBufAllocator alloc, boolean startTls) {
return new SslHandler(newEngine(alloc), startTls);
}
代码示例来源:origin: wildfly/wildfly
@Override
public final SSLEngine newEngine(ByteBufAllocator alloc, String peerHost, int peerPort) {
SSLEngine engine = ctx.newEngine(alloc, peerHost, peerPort);
initEngine(engine);
return engine;
}
代码示例来源:origin: wildfly/wildfly
/**
* Create a new SslHandler.
* @see #newHandler(ByteBufAllocator, String, int, boolean)
*/
protected SslHandler newHandler(ByteBufAllocator alloc, String peerHost, int peerPort, boolean startTls) {
return new SslHandler(newEngine(alloc, peerHost, peerPort), startTls);
}
代码示例来源:origin: wildfly/wildfly
@Override
public final SSLEngine newEngine(ByteBufAllocator alloc) {
SSLEngine engine = ctx.newEngine(alloc);
initEngine(engine);
return engine;
}
代码示例来源:origin: AsyncHttpClient/async-http-client
@Override
public SSLEngine newSslEngine(AsyncHttpClientConfig config, String peerHost, int peerPort) {
SSLEngine sslEngine =
config.isDisableHttpsEndpointIdentificationAlgorithm() ?
sslContext.newEngine(ByteBufAllocator.DEFAULT) :
sslContext.newEngine(ByteBufAllocator.DEFAULT, domain(peerHost), peerPort);
configureSslEngine(sslEngine, config);
return sslEngine;
}
代码示例来源:origin: eclipse-vertx/vert.x
public SSLEngine createEngine(VertxInternal vertx, String host, int port, boolean forceSNI) {
SSLEngine engine = getContext(vertx, null).newEngine(ByteBufAllocator.DEFAULT, host, port);
configureEngine(engine, forceSNI ? host : null);
return engine;
}
代码示例来源:origin: eclipse-vertx/vert.x
public SSLEngine createEngine(VertxInternal vertx, String host, int port) {
SSLEngine engine = getContext(vertx, null).newEngine(ByteBufAllocator.DEFAULT, host, port);
configureEngine(engine, null);
return engine;
}
代码示例来源:origin: eclipse-vertx/vert.x
public SSLEngine createEngine(VertxInternal vertx) {
SSLEngine engine = getContext(vertx, null).newEngine(ByteBufAllocator.DEFAULT);
configureEngine(engine, null);
return engine;
}
}
代码示例来源:origin: neo4j/neo4j
private ChannelHandler nettyServerHandler( Channel channel, SslContext sslContext )
{
SSLEngine sslEngine = sslContext.newEngine( channel.alloc() );
return new SslHandler( sslEngine );
}
代码示例来源:origin: eclipse-vertx/vert.x
public SSLEngine createEngine(VertxInternal vertx, SocketAddress socketAddress, String serverName) {
SslContext context = getContext(vertx, null);
SSLEngine engine;
if (socketAddress.path() != null) {
engine = context.newEngine(ByteBufAllocator.DEFAULT);
} else {
engine = context.newEngine(ByteBufAllocator.DEFAULT, socketAddress.host(), socketAddress.port());
}
configureEngine(engine, serverName);
return engine;
}
代码示例来源:origin: normanmaurer/netty-in-action
@Override
protected void initChannel(Channel ch) throws Exception {
SSLEngine engine = context.newEngine(ch.alloc());
ch.pipeline().addFirst("ssl",
new SslHandler(engine, startTls));
}
}
代码示例来源:origin: normanmaurer/netty-in-action
@Override
protected void initChannel(Channel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
SSLEngine engine = context.newEngine(ch.alloc());
pipeline.addFirst("ssl", new SslHandler(engine));
if (isClient) {
pipeline.addLast("codec", new HttpClientCodec());
} else {
pipeline.addLast("codec", new HttpServerCodec());
}
}
}
代码示例来源:origin: JZ-Darkal/AndroidHttpCapture
@Override
public SSLEngine clientSslEngineFor(HttpRequest httpRequest, SSLSession sslSession) {
String requestedHostname = HttpUtil.getHostFromRequest(httpRequest);
try {
SslContext ctx = getHostnameImpersonatingSslContext(requestedHostname, sslSession);
return ctx.newEngine(ByteBufAllocator.DEFAULT);
} catch (RuntimeException e) {
throw new MitmException("Error creating SSLEngine for connection to client to impersonate upstream host: " + requestedHostname, e);
}
}
内容来源于网络,如有侵权,请联系作者删除!