These code examples were ranked by Codota’s semantic indexing as the best open source examples for SSLServerSocket getSupportedProtocols method.
* javax.net.ssl.SSLServerSocket#setEnabledProtocols(String[] protocols) */ public void test_EnabledProtocols() throws Exception { SSLServerSocket sss = getSSLServerSocket(); try { sss.setEnabledProtocols(null); } catch (IllegalArgumentException iae) { //expected } String[] unsupportedProtocols = {"unsupported"}; try { sss.setEnabledProtocols(unsupportedProtocols); } catch (IllegalArgumentException iae) { //expected } int count = sss.getSupportedProtocols().length; assertTrue("No supported protocols", count > 0); sss.setEnabledProtocols(sss.getSupportedProtocols()); String[] res = sss.getEnabledProtocols(); assertNotNull("NULL result", res);
final SSLServerSocket socket = (SSLServerSocket)m_serverSocketFactory.createServerSocket( localEndPoint.getPort(), 50, InetAddress.getByName(localEndPoint.getHost())); socket.setSoTimeout(timeout); socket.setEnabledCipherSuites(socket.getSupportedCipherSuites()); socket.setEnabledProtocols(socket.getSupportedProtocols()); return socket; } /** * Factory method for client sockets. * * @param remoteEndPoint Remote host and port. * @return A new <code>Socket</code>. * @exception IOException If an error occurs. */
final SSLServerSocket socket = (SSLServerSocket)m_serverSocketFactory.createServerSocket( localEndPoint.getPort(), 50, InetAddress.getByName(localEndPoint.getHost())); socket.setSoTimeout(timeout); socket.setEnabledCipherSuites(socket.getSupportedCipherSuites()); socket.setEnabledProtocols(socket.getSupportedProtocols()); return socket; } /** * Factory method for client sockets. * * @param remoteEndPoint Remote host and port. * @return A new <code>Socket</code>. * @exception IOException If an error occurs. */
public String[] getSupportedCipherSuites() { return delegate.getSupportedCipherSuites(); } public String[] getSupportedProtocols() { return delegate.getSupportedProtocols(); } public boolean getUseClientMode() { return delegate.getUseClientMode(); } public boolean getWantClientAuth() { return delegate.getWantClientAuth(); } public int hashCode() { return delegate.hashCode(); }