本文整理了Java中javax.net.ssl.SSLServerSocket.getLocalPort()
方法的一些代码示例,展示了SSLServerSocket.getLocalPort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SSLServerSocket.getLocalPort()
方法的具体详情如下:
包路径:javax.net.ssl.SSLServerSocket
类名称:SSLServerSocket
方法名:getLocalPort
暂无
代码示例来源:origin: wildfly/wildfly
public int getLocalPort() {
return delegate.getLocalPort();
}
代码示例来源:origin: org.apache.logging.log4j/log4j-core
public MockTlsSyslogServer(final int loopLen, final TlsSyslogMessageFormat format, final SSLServerSocket serverSocket) {
super(loopLen, serverSocket.getLocalPort());
this.messageFormat = format;
this.loopLen = loopLen;
this.serverSocket = serverSocket;
}
代码示例来源:origin: apache/zookeeper
@Test(timeout = 5000)
public void testCreateSSLServerSocketWithPort() throws Exception {
int port = PortAssignment.unique();
setCustomCipherSuites();
SSLServerSocket sslServerSocket = x509Util.createSSLServerSocket(port);
Assert.assertEquals(sslServerSocket.getLocalPort(), port);
Assert.assertArrayEquals(customCipherSuites, sslServerSocket.getEnabledCipherSuites());
Assert.assertTrue(sslServerSocket.getNeedClientAuth());
}
代码示例来源:origin: apache/karaf
@Override
public int getLocalPort() {
return ss.getLocalPort();
}
代码示例来源:origin: org.wildfly.security/wildfly-elytron
public int getLocalPort() {
return delegate.getLocalPort();
}
代码示例来源:origin: org.wildfly.security/wildfly-elytron-ssl
public int getLocalPort() {
return delegate.getLocalPort();
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
public int getLocalPort() {
return delegate.getLocalPort();
}
代码示例来源:origin: osiegmar/logback-gelf
int getPort() {
return server.getLocalPort();
}
代码示例来源:origin: org.coosproject.messaging/messaging-lib
listenPort = serverSocket.getLocalPort();
logger.info(" Listening on port " + listenPort);
serverSocket.setSoTimeout(500);
代码示例来源:origin: palantir/conjure-java-runtime
private void runSslConnectionTest(
SslConfiguration serverConfig,
SslConfiguration clientConfig,
ClientAuth clientAuth) {
String message = UUID.randomUUID().toString();
SSLContext sslContext = SslSocketFactories.createSslContext(serverConfig);
SSLServerSocketFactory factory = sslContext.getServerSocketFactory();
try (SSLServerSocket sslServerSocket = (SSLServerSocket) factory.createServerSocket(0)) {
Thread serverThread = createSslServerThread(sslServerSocket, clientAuth, message);
serverThread.start();
SSLSocketFactory sslSocketFactory = SslSocketFactories.createSslSocketFactory(clientConfig);
verifySslConnection(sslSocketFactory, sslServerSocket.getLocalPort(), message);
} catch (IOException ex) {
Throwables.propagate(ex);
}
}
代码示例来源:origin: komamitsu/fluency
SSLSocket sslSocket = new SSLSocketBuilder("localhost", serverSocket.getLocalPort(), 5000, 5000).build();
代码示例来源:origin: apache/httpcomponents-core
final int localPort = serverSocket.getLocalPort();
try (final SSLSocket clientSocket = (SSLSocket) clientSslContext.getSocketFactory().createSocket()) {
clientSocket.connect(new InetSocketAddress("localhost", localPort), TIMEOUT.toMillisIntBound());
代码示例来源:origin: apache/httpcomponents-core
final int localPort = serverSocket.getLocalPort();
try (final SSLSocket clientSocket = (SSLSocket) clientSslContext.getSocketFactory().createSocket()) {
final Set<String> supportedClientProtocols = new LinkedHashSet<>(Arrays.asList(clientSocket.getSupportedProtocols()));
代码示例来源:origin: apache/httpcomponents-core
final int localPort = serverSocket.getLocalPort();
try (final SSLSocket clientSocket = (SSLSocket) clientSslContext.getSocketFactory().createSocket()) {
clientSocket.connect(new InetSocketAddress("localhost", localPort), TIMEOUT.toMillisIntBound());
代码示例来源:origin: apache/httpcomponents-core
final int localPort = serverSocket.getLocalPort();
try (final SSLSocket clientSocket = (SSLSocket) clientSslContext.getSocketFactory().createSocket()) {
clientSocket.connect(new InetSocketAddress("localhost", localPort), TIMEOUT.toMillisIntBound());
代码示例来源:origin: apache/httpcomponents-core
final int localPort = serverSocket.getLocalPort();
try (final SSLSocket clientSocket = (SSLSocket) clientSslContext.getSocketFactory().createSocket()) {
clientSocket.connect(new InetSocketAddress("localhost", localPort), TIMEOUT.toMillisIntBound());
代码示例来源:origin: apache/httpcomponents-core
final int localPort = serverSocket.getLocalPort();
try (final SSLSocket clientSocket = (SSLSocket) clientSslContext.getSocketFactory().createSocket()) {
final Set<String> supportedClientProtocols = new LinkedHashSet<>(
代码示例来源:origin: komamitsu/fluency
@Before
public void setUp()
throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException, KeyManagementException, KeyStoreException
{
sslServerSocket = new SSLTestServerSocketFactory().create();
SSLHeartbeater.Config config = new SSLHeartbeater.Config();
config.setPort(sslServerSocket.getLocalPort());
config.setIntervalMillis(500);
heartbeater = new SSLHeartbeater(config);
}
内容来源于网络,如有侵权,请联系作者删除!