Lines Matching defs:socket

53  * The handshake timeout does not apply to actual TCP socket connection.
62 * use {@link InetAddress} or which return an unconnected socket, you MUST
69 * <p>On development devices, "setprop socket.relaxsslcheck yes" bypasses all
110 * Returns a new socket factory instance with an optional handshake timeout.
113 * for none. The socket timeout is reset to 0 after the handshake.
121 * Returns a new socket factory instance with an optional handshake timeout
125 * for none. The socket timeout is reset to 0 after the handshake.
134 * Returns a new instance of a socket factory with all SSL security checks
141 * for none. The socket timeout is reset to 0 after the handshake.
150 * Returns a socket factory (also named SSLSocketFactory, but in a different
154 * for none. The socket timeout is reset to 0 after the handshake.
174 * connected socket. You MUST call this if you did not supply a hostname
182 * @param socket An SSL socket which has been connected to a server
189 public static void verifyHostname(Socket socket, String hostname) throws IOException {
190 if (!(socket instanceof SSLSocket)) {
191 throw new IllegalArgumentException("Attempt to verify non-SSL socket");
197 SSLSocket ssl = (SSLSocket) socket;
202 throw new SSLException("Cannot verify SSL socket without session");
225 "yes".equals(SystemProperties.get("socket.relaxsslcheck"));
233 Log.w(TAG, "*** BYPASSING SSL SECURITY CHECKS (socket.relaxsslcheck=yes) ***");
334 * @param socket a socket created by this factory.
335 * @throws IllegalArgumentException if the socket was not created by this factory.
337 public byte[] getNpnSelectedProtocol(Socket socket) {
338 return castToOpenSSLSocket(socket).getNpnSelectedProtocol();
347 * @param socket a socket created by this factory.
348 * @throws IllegalArgumentException if the socket was not created by this factory.
351 public byte[] getAlpnSelectedProtocol(Socket socket) {
352 return castToOpenSSLSocket(socket).getAlpnSelectedProtocol();
382 * support on the given socket.
384 * @param socket a socket created by this factory
385 * @param useSessionTickets {@code true} to enable session ticket support on this socket.
386 * @throws IllegalArgumentException if the socket was not created by this factory.
388 public void setUseSessionTickets(Socket socket, boolean useSessionTickets) {
389 castToOpenSSLSocket(socket).setUseSessionTickets(useSessionTickets);
394 * Name Indication (SNI)</a> on a given socket.
396 * @param socket a socket created by this factory.
398 * @throws IllegalArgumentException if the socket was not created by this factory.
400 public void setHostname(Socket socket, String hostName) {
401 castToOpenSSLSocket(socket).setHostname(hostName);
405 * Sets this socket's SO_SNDTIMEO write timeout in milliseconds.
409 * @param socket a socket created by this factory.
411 * @throws IllegalArgumentException if the socket was not created by this factory.
415 public void setSoWriteTimeout(Socket socket, int writeTimeoutMilliseconds)
417 castToOpenSSLSocket(socket).setSoWriteTimeout(writeTimeoutMilliseconds);
420 private static OpenSSLSocketImpl castToOpenSSLSocket(Socket socket) {
421 if (!(socket instanceof OpenSSLSocketImpl)) {
423 + socket);
426 return (OpenSSLSocketImpl) socket;
449 * Creates a new socket which is not connected to any remote host.
450 * You must use {@link Socket#connect} to connect the socket.
454 * the socket to avoid man-in-the-middle attacks.</p>
471 * the socket to avoid man-in-the-middle attacks.</p>
490 * the socket to avoid man-in-the-middle attacks.</p>