Code example for SSLContext

Methods: getServerSocketFactory

0
	 * If we don't check now, the JIoEndpoint can enter a nasty logging loop. 
	 * See bug 45528. 
	 */ 
	private void checkConfig() throws IOException { 
		// Create an unbound server socket 
		SSLServerSocketFactory sslProxy = sslContext.getServerSocketFactory();
		ServerSocket socket = sslProxy.createServerSocket();
		// SSLEngine engine = sslContext.createSSLEngine(); 
		// initSSLEngine(engine); 
 
		try { 
			// Set the timeout to 1ms as all we care about is if it throws an 
			// SSLException on accept. 
			socket.setSoTimeout(1);
			socket.accept();
			// Will never get here - no client can connect to an unbound port 
		} catch (SSLException ssle) {
			// SSL configuration is invalid. Possibly cert doesn't match ciphers 
			IOException ioe = new IOException(sm.getString("jsse.invalid_ssl_conf",
					ssle.getMessage()));
			ioe.initCause(ssle);