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.
172 * connected socket. You MUST call this if you did not supply a hostname
180 * @param socket An SSL socket which has been connected to a server
187 public static void verifyHostname(Socket socket, String hostname) throws IOException {
188 if (!(socket instanceof SSLSocket)) {
189 throw new IllegalArgumentException("Attempt to verify non-SSL socket");
195 SSLSocket ssl = (SSLSocket) socket;
200 throw new SSLException("Cannot verify SSL socket without session");
223 "yes".equals(SystemProperties.get("socket.relaxsslcheck"));
231 Log.w(TAG, "*** BYPASSING SSL SECURITY CHECKS (socket.relaxsslcheck=yes) ***");
332 * @param socket a socket created by this factory.
333 * @throws IllegalArgumentException if the socket was not created by this factory.
335 public byte[] getNpnSelectedProtocol(Socket socket) {
336 return castToOpenSSLSocket(socket).getNpnSelectedProtocol();
345 * @param socket a socket created by this factory.
346 * @throws IllegalArgumentException if the socket was not created by this factory.
349 public byte[] getAlpnSelectedProtocol(Socket socket) {
350 return castToOpenSSLSocket(socket).getAlpnSelectedProtocol();
380 * support on the given socket.
382 * @param socket a socket created by this factory
383 * @param useSessionTickets {@code true} to enable session ticket support on this socket.
384 * @throws IllegalArgumentException if the socket was not created by this factory.
386 public void setUseSessionTickets(Socket socket, boolean useSessionTickets) {
387 castToOpenSSLSocket(socket).setUseSessionTickets(useSessionTickets);
392 * Name Indication (SNI)</a> on a given socket.
394 * @param socket a socket created by this factory.
396 * @throws IllegalArgumentException if the socket was not created by this factory.
398 public void setHostname(Socket socket, String hostName) {
399 castToOpenSSLSocket(socket).setHostname(hostName);
403 * Sets this socket's SO_SNDTIMEO write timeout in milliseconds.
407 * @param socket a socket created by this factory.
409 * @throws IllegalArgumentException if the socket was not created by this factory.
413 public void setSoWriteTimeout(Socket socket, int writeTimeoutMilliseconds)
415 castToOpenSSLSocket(socket).setSoWriteTimeout(writeTimeoutMilliseconds);
418 private static OpenSSLSocketImpl castToOpenSSLSocket(Socket socket) {
419 if (!(socket instanceof OpenSSLSocketImpl)) {
421 + socket);
424 return (OpenSSLSocketImpl) socket;
447 * Creates a new socket which is not connected to any remote host.
448 * You must use {@link Socket#connect} to connect the socket.
452 * the socket to avoid man-in-the-middle attacks.</p>
469 * the socket to avoid man-in-the-middle attacks.</p>
488 * the socket to avoid man-in-the-middle attacks.</p>