Java 8 SSLSocketFactory - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SSLSocketFactory class.

This code example shows how to use the following methods:createSocket
    public Socket createSocket(String s, int i, InetAddress inaddr, int j) throws IOException {
        return factory.createSocket(s, i, inaddr, j);
    } 
 
    public Socket createSocket(String s, int i) throws IOException {
        return factory.createSocket(s, i);
    } 
 
    public String[] getDefaultCipherSuites() {
        return factory.getDefaultCipherSuites();
    } 
 
    public String[] getSupportedCipherSuites() {
        return factory.getSupportedCipherSuites();
    } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:createSocket
        return delegate.getSupportedCipherSuites();
    } 
 
    @Override 
    public Socket createSocket(String host, int port) throws IOException {
        return delegate.createSocket(host, port);
    } 
 
    @Override 
    public Socket createSocket(InetAddress address, int port) throws IOException {
        return delegate.createSocket(address, port);
    } 
 
    @Override 
    public Socket createSocket(String host, int port, InetAddress localAddress, int localPort) throws IOException {
        return delegate.createSocket(host, port, localAddress, localPort);
    } 
 
    @Override 
    public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:createSocket
    public Socket createSocket(String host, int port) throws IOException {
        this.initSSLContext();
        InetAddress address = InetAddress.getByName(host);
 
        SSLSocketFactory socketFactory = this.sslContext.getSocketFactory();
        SSLSocket socket = (SSLSocket) socketFactory.createSocket(address, port);
        if (this.jsseSecurityDomain.getProtocols() != null)
            socket.setEnabledProtocols(this.jsseSecurityDomain.getProtocols());
        if (this.jsseSecurityDomain.getCipherSuites() != null)
            socket.setEnabledCipherSuites(this.jsseSecurityDomain.getCipherSuites());
        socket.setNeedClientAuth(this.jsseSecurityDomain.isClientAuth());
        return socket;
    } 
 
    @Override 
    public Socket createSocket(String host, int port, int timeout) throws IOException, TIMEOUT {
        this.initSSLContext();
        InetAddress address = InetAddress.getByName(host);
 
        SSLSocketFactory socketFactory = this.sslContext.getSocketFactory();
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:createSocket
    public Socket createSocket() throws IOException {
        return factory.createSocket();
    } 
 
    public Socket createSocket(InetAddress inaddr, int i, InetAddress inaddr1, int j) throws IOException {
        return factory.createSocket(inaddr, i, inaddr1, j);
    } 
 
    public Socket createSocket(InetAddress inaddr, int i) throws IOException {
        return factory.createSocket(inaddr, i);
    } 
 
    public Socket createSocket(String s, int i, InetAddress inaddr, int j) throws IOException {
        return factory.createSocket(s, i, inaddr, j);
    } 
 
    public Socket createSocket(String s, int i) throws IOException {
        return factory.createSocket(s, i);
    } 
 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:createSocket
    public Socket createSocket() throws IOException {
        return factory.createSocket();
    } 
 
    public Socket createSocket(InetAddress inaddr, int i, InetAddress inaddr1, int j) throws IOException {
        return factory.createSocket(inaddr, i, inaddr1, j);
    } 
 
    public Socket createSocket(InetAddress inaddr, int i) throws IOException {
        return factory.createSocket(inaddr, i);
    } 
 
    public Socket createSocket(String s, int i, InetAddress inaddr, int j) throws IOException {
        return factory.createSocket(s, i, inaddr, j);
    } 
 
    public Socket createSocket(String s, int i) throws IOException {
        return factory.createSocket(s, i);
    } 
 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:createSocket
        // use a non-existing provider so that the DefaultSSLSocketFactory 
        // will be used, and then test against it. 
        Security.setProperty("ssl.SocketFactory.provider", "foo.NonExistant");
        SSLSocketFactory fac = (SSLSocketFactory)SSLSocketFactory.getDefault();
        try { 
            fac.createSocket();
        } catch(SocketException se) {
            // if exception caught, then it's ok 
            System.out.println("Throw SocketException");
            se.printStackTrace();
            return; 
        } 
        throw new Exception("should throw SocketException");
        // if not caught, or other exception caught, then it's error 
    } 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:createSocket
  } 
 
  @Override 
  public Socket createSocket(Socket s, String host, int port, boolean autoClose)
      throws IOException { 
    return sslFactory.createSocket(s, host, port, autoClose);
  } 
 
  @Override 
  public String[] getDefaultCipherSuites() {
    return sslFactory.getDefaultCipherSuites();
  } 
 
  @Override 
  public String[] getSupportedCipherSuites() {
    return sslFactory.getSupportedCipherSuites();
  } 
 
  @Override 
  public Socket createSocket() throws IOException {
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getSupportedCipherSuites
    // To Fix: 
    //  Try switching to the Sun JRE or adding jsse.jar (part of the Sun JRE) to your class path. 
    return factory.createSocket();
  } 
  public String[] getDefaultCipherSuites() {
    return factory.getSupportedCipherSuites();
  } 
  public String[] getSupportedCipherSuites() {
    return factory.getSupportedCipherSuites();
  } 
   
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getSupportedCipherSuites
	public Socket createSocket(String s, int i) throws IOException {
		return factory.createSocket(s, i);
	} 
 
	public String[] getDefaultCipherSuites() {
		return factory.getSupportedCipherSuites();
	} 
 
	public String[] getSupportedCipherSuites() {
		return factory.getSupportedCipherSuites();
	} 
 
	public Socket createSocket() throws IOException {
		return factory.createSocket();
	} 
 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getSupportedCipherSuites
    public String[] getDefaultCipherSuites() {
    return factory.getDefaultCipherSuites();
    } 
 
    public String[] getSupportedCipherSuites() {
    return factory.getSupportedCipherSuites();
    } 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Java 8 SSLSocketFactory Questions & Answers:

See Code Examples for Java 8 SSLSocketFactory Methods: