use of javax.net.ssl.SSLServerSocket in project wildfly by wildfly.
the class LegacySSLSocketFactory method createSSLServerSocket.
public ServerSocket createSSLServerSocket(int port, int backlog, InetAddress inetAddress) throws IOException {
this.initSSLContext();
SSLServerSocketFactory serverSocketFactory = this.sslContext.getServerSocketFactory();
SSLServerSocket serverSocket = (SSLServerSocket) serverSocketFactory.createServerSocket(port, backlog, inetAddress);
if (this.jsseSecurityDomain.getProtocols() != null) {
serverSocket.setEnabledProtocols(this.jsseSecurityDomain.getProtocols());
}
if (this.jsseSecurityDomain.getCipherSuites() != null) {
serverSocket.setEnabledCipherSuites(this.jsseSecurityDomain.getCipherSuites());
}
if (this.jsseSecurityDomain.isClientAuth() || this.require_mutual_auth) {
serverSocket.setNeedClientAuth(true);
} else {
serverSocket.setWantClientAuth(this.request_mutual_auth);
}
return serverSocket;
}
use of javax.net.ssl.SSLServerSocket in project eiger by wlloyd.
the class SSLFactory method getServerSocket.
public static SSLServerSocket getServerSocket(EncryptionOptions options, InetAddress address, int port) throws IOException {
SSLContext ctx = createSSLContext(options);
SSLServerSocket serverSocket = (SSLServerSocket) ctx.getServerSocketFactory().createServerSocket();
serverSocket.setReuseAddress(true);
String[] suits = filterCipherSuites(serverSocket.getSupportedCipherSuites(), options.cipher_suites);
serverSocket.setEnabledCipherSuites(suits);
serverSocket.bind(new InetSocketAddress(address, port), 100);
return serverSocket;
}
use of javax.net.ssl.SSLServerSocket in project aries by apache.
the class IntrospectionSupport method setProperty.
public static boolean setProperty(Object target, String name, Object value) {
try {
Class<?> clazz = target.getClass();
if (target instanceof SSLServerSocket) {
// overcome illegal access issues with internal implementation class
clazz = SSLServerSocket.class;
}
Method setter = findSetterMethod(clazz, name);
if (setter == null) {
return false;
}
// value directly
if (value == null || value.getClass() == setter.getParameterTypes()[0]) {
setter.invoke(target, value);
} else {
// We need to convert it
setter.invoke(target, convert(value, setter.getParameterTypes()[0]));
}
return true;
} catch (Exception e) {
LOG.error(String.format("Could not set property %s on %s", name, target), e);
return false;
}
}
use of javax.net.ssl.SSLServerSocket in project logging-log4j2 by apache.
the class TlsSyslogAppenderTest method initTlsTestEnvironment.
private void initTlsTestEnvironment(final int numberOfMessages, final TlsSyslogMessageFormat messageFormat) throws IOException {
this.messageFormat = messageFormat;
final SSLServerSocket sslServerSocket = (SSLServerSocket) serverSocketFactory.createServerSocket(PORTNUM);
syslogServer = MockSyslogServerFactory.createTLSSyslogServer(numberOfMessages, messageFormat, sslServerSocket);
syslogServer.start();
initAppender();
}
use of javax.net.ssl.SSLServerSocket in project robovm by robovm.
the class SSLServerSocketTest method test_getSupportedProtocols.
/**
* @throws IOException
* javax.net.ssl.SSLServerSocket#getSupportedProtocols()
*/
public void test_getSupportedProtocols() throws Exception {
SSLServerSocket sss = getSSLServerSocket();
String[] res = sss.getSupportedCipherSuites();
assertNotNull("NULL result", res);
assertTrue("no supported protocols available.", res.length > 0);
}
Aggregations