public SSLSocket buildSocket ( ) throws KeyStoreException , CertificateException , NoSuchAlgorithmException , IOException , UnrecoverableKeyException , KeyManagementException { if ( host == null ) throw new IllegalStateException ( "Cannot create socket without host" ) ; // Get socket final SSLSocket s = ( SSLSocket ) build ( ) . getSocketFactory ( ) . createSocket ( host , port ) ; // Set protocols s . setEnabledProtocols ( TLS . getUsable ( TLS . TLS_PROTOCOLS , s . getSupportedProtocols ( ) ) ) ; s . setEnabledCipherSuites ( TLS . getUsable ( TLS . TLS_CIPHER_SUITES , s . getSupportedCipherSuites ( ) ) ) ; return s ; }
Builds a new Socket