SSLServerSocket getSupportedProtocols - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SSLServerSocket getSupportedProtocols method.

This code example shows how to use the following methods:getEnabledProtocols, getSupportedProtocols, setEnabledProtocols
     * 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);

7
CodeRank
This code example shows how to use the following methods:setSoTimeout, getSupportedCipherSuites, getSupportedProtocols, setEnabledCipherSuites, setEnabledProtocols
    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. 
   */ 
6
CodeRank
This code example shows how to use the following methods:setSoTimeout, getSupportedCipherSuites, getSupportedProtocols, setEnabledCipherSuites, setEnabledProtocols
    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. 
   */ 
6
CodeRank
This code example shows how to use the following methods:getSupportedProtocols
	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();
	} 
 
5
CodeRank
getSupportedProtocols Method Overview
Returns the names of the supported protocols.
See Code Examples for other Java 8 SSLServerSocket Methods: