public boolean isSecure(Socket sock) throws IllegalArgumentException {
  if (sock == null) {
    throw new IllegalArgumentException("Socket may not be null.");
  }
  if (!(sock instanceof SSLSocket)) {
    throw new IllegalArgumentException("Socket not created by this factory.");
  }
  if (sock.isClosed()) {
    throw new IllegalArgumentException("Socket is closed.");
  }
  return true;
}

public boolean isSecure ( Socket sock ) throws IllegalArgumentException { if ( sock == null ) { throw new IllegalArgumentException ( "Socket may not be null." ) ; } if ( ! ( sock instanceof SSLSocket ) ) { throw new IllegalArgumentException ( "Socket not created by this factory." ) ; } if ( sock . isClosed ( ) ) { throw new IllegalArgumentException ( "Socket is closed." ) ; } return true ; }
checks whether a socket connection is secure . this factory creates tls / ssl socket connections which , by default , are considered secure . < br / > derived classes may override this method to perform runtime checks , for example based on the cypher suite .
