Lines Matching refs:socket

56  * The handshake timeout does not apply to actual TCP socket connection.
65 * use {@link InetAddress} or which return an unconnected socket, you MUST
77 * <p>On development devices, "setprop socket.relaxsslcheck yes" bypasses all
118 * Returns a new socket factory instance with an optional handshake timeout.
121 * for none. The socket timeout is reset to 0 after the handshake.
129 * Returns a new socket factory instance with an optional handshake timeout
133 * for none. The socket timeout is reset to 0 after the handshake.
142 * Returns a new instance of a socket factory with all SSL security checks
149 * for none. The socket timeout is reset to 0 after the handshake.
158 * Returns a socket factory (also named SSLSocketFactory, but in a different
162 * for none. The socket timeout is reset to 0 after the handshake.
182 * connected socket. You MUST call this if you did not supply a hostname
190 * @param socket An SSL socket which has been connected to a server
197 public static void verifyHostname(Socket socket, String hostname) throws IOException {
198 if (!(socket instanceof SSLSocket)) {
199 throw new IllegalArgumentException("Attempt to verify non-SSL socket");
205 SSLSocket ssl = (SSLSocket) socket;
210 throw new SSLException("Cannot verify SSL socket without session");
233 SystemProperties.getBoolean("socket.relaxsslcheck", false);
241 Log.w(TAG, "*** BYPASSING SSL SECURITY CHECKS (socket.relaxsslcheck=yes) ***");
342 * @param socket a socket created by this factory.
343 * @throws IllegalArgumentException if the socket was not created by this factory.
345 public byte[] getNpnSelectedProtocol(Socket socket) {
346 return castToOpenSSLSocket(socket).getNpnSelectedProtocol();
355 * @param socket a socket created by this factory.
356 * @throws IllegalArgumentException if the socket was not created by this factory.
359 public byte[] getAlpnSelectedProtocol(Socket socket) {
360 return castToOpenSSLSocket(socket).getAlpnSelectedProtocol();
390 * support on the given socket.
392 * @param socket a socket created by this factory
393 * @param useSessionTickets {@code true} to enable session ticket support on this socket.
394 * @throws IllegalArgumentException if the socket was not created by this factory.
396 public void setUseSessionTickets(Socket socket, boolean useSessionTickets) {
397 castToOpenSSLSocket(socket).setUseSessionTickets(useSessionTickets);
402 * Name Indication (SNI)</a> on a given socket.
404 * @param socket a socket created by this factory.
406 * @throws IllegalArgumentException if the socket was not created by this factory.
408 public void setHostname(Socket socket, String hostName) {
409 castToOpenSSLSocket(socket).setHostname(hostName);
413 * Sets this socket's SO_SNDTIMEO write timeout in milliseconds.
417 * @param socket a socket created by this factory.
419 * @throws IllegalArgumentException if the socket was not created by this factory.
423 public void setSoWriteTimeout(Socket socket, int writeTimeoutMilliseconds)
425 castToOpenSSLSocket(socket).setSoWriteTimeout(writeTimeoutMilliseconds);
428 private static OpenSSLSocketImpl castToOpenSSLSocket(Socket socket) {
429 if (!(socket instanceof OpenSSLSocketImpl)) {
431 + socket);
434 return (OpenSSLSocketImpl) socket;
457 * Creates a new socket which is not connected to any remote host.
458 * You must use {@link Socket#connect} to connect the socket.
462 * the socket to avoid man-in-the-middle attacks.</p>
479 * the socket to avoid man-in-the-middle attacks.</p>
498 * the socket to avoid man-in-the-middle attacks.</p>