@@ -90,7 +90,6 @@ public void checkServerTrusted(X509Certificate[] certs, String authType) { }
9090 private byte [] mNpnProtocols = null ;
9191
9292 private final int mHandshakeTimeoutMillis ;
93- private final int mWriteTimeoutMillis ;
9493 private final SSLClientSessionCache mSessionCache ;
9594 private final boolean mSecure ;
9695
@@ -101,21 +100,12 @@ public SSLCertificateSocketFactory(int handshakeTimeoutMillis) {
101100 }
102101
103102 private SSLCertificateSocketFactory (
104- int handshakeTimeoutMillis ,
105- int writeTimeoutMillis ,
106- SSLSessionCache cache ,
107- boolean secure ) {
103+ int handshakeTimeoutMillis , SSLSessionCache cache , boolean secure ) {
108104 mHandshakeTimeoutMillis = handshakeTimeoutMillis ;
109- mWriteTimeoutMillis = writeTimeoutMillis ;
110105 mSessionCache = cache == null ? null : cache .mSessionCache ;
111106 mSecure = secure ;
112107 }
113108
114- private SSLCertificateSocketFactory (
115- int handshakeTimeoutMillis , SSLSessionCache cache , boolean secure ) {
116- this (handshakeTimeoutMillis , 0 , cache , secure );
117- }
118-
119109 /**
120110 * Returns a new socket factory instance with an optional handshake timeout.
121111 *
@@ -171,24 +161,6 @@ public static org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(
171161 new SSLCertificateSocketFactory (handshakeTimeoutMillis , cache , true ));
172162 }
173163
174- /**
175- * Returns a socket factory (also named SSLSocketFactory, but in a different
176- * namespace) for use with the Apache HTTP stack.
177- *
178- * @param handshakeTimeoutMillis to use for SSL connection handshake, or 0
179- * for none. The socket timeout is reset to 0 after the handshake.
180- * @param writeTimeoutMillis the desired write timeout in milliseconds or 0 for none.
181- * @param cache The {@link SSLSessionCache} to use, or null for no cache.
182- * @return a new SocketFactory with the specified parameters
183- */
184- public static org .apache .http .conn .ssl .SSLSocketFactory getHttpSocketFactory (
185- int handshakeTimeoutMillis ,
186- int writeTimeoutMillis ,
187- SSLSessionCache cache ) {
188- return new org .apache .http .conn .ssl .SSLSocketFactory (new SSLCertificateSocketFactory (
189- handshakeTimeoutMillis , writeTimeoutMillis , cache , true ));
190- }
191-
192164 /**
193165 * Verify the hostname of the certificate used by the other end of a
194166 * connected socket. You MUST call this if you did not supply a hostname
@@ -376,8 +348,10 @@ public void setHostname(Socket socket, String hostName) {
376348 * To take effect, this option must be set before the blocking method was called.
377349 *
378350 * @param socket a socket created by this factory.
379- * @param writeTimeoutMilliseconds the desired write timeout in milliseconds.
351+ * @param timeout the desired write timeout in milliseconds.
380352 * @throws IllegalArgumentException if the socket was not created by this factory.
353+ *
354+ * @hide
381355 */
382356 public void setSoWriteTimeout (Socket socket , int writeTimeoutMilliseconds )
383357 throws SocketException {
@@ -404,7 +378,6 @@ public Socket createSocket(Socket k, String host, int port, boolean close) throw
404378 OpenSSLSocketImpl s = (OpenSSLSocketImpl ) getDelegate ().createSocket (k , host , port , close );
405379 s .setNpnProtocols (mNpnProtocols );
406380 s .setHandshakeTimeout (mHandshakeTimeoutMillis );
407- s .setSoWriteTimeout (mWriteTimeoutMillis );
408381 if (mSecure ) {
409382 verifyHostname (s , host );
410383 }
@@ -424,7 +397,6 @@ public Socket createSocket() throws IOException {
424397 OpenSSLSocketImpl s = (OpenSSLSocketImpl ) getDelegate ().createSocket ();
425398 s .setNpnProtocols (mNpnProtocols );
426399 s .setHandshakeTimeout (mHandshakeTimeoutMillis );
427- s .setSoWriteTimeout (mWriteTimeoutMillis );
428400 return s ;
429401 }
430402
@@ -442,7 +414,6 @@ public Socket createSocket(InetAddress addr, int port, InetAddress localAddr, in
442414 addr , port , localAddr , localPort );
443415 s .setNpnProtocols (mNpnProtocols );
444416 s .setHandshakeTimeout (mHandshakeTimeoutMillis );
445- s .setSoWriteTimeout (mWriteTimeoutMillis );
446417 return s ;
447418 }
448419
@@ -458,7 +429,6 @@ public Socket createSocket(InetAddress addr, int port) throws IOException {
458429 OpenSSLSocketImpl s = (OpenSSLSocketImpl ) getDelegate ().createSocket (addr , port );
459430 s .setNpnProtocols (mNpnProtocols );
460431 s .setHandshakeTimeout (mHandshakeTimeoutMillis );
461- s .setSoWriteTimeout (mWriteTimeoutMillis );
462432 return s ;
463433 }
464434
@@ -475,7 +445,6 @@ public Socket createSocket(String host, int port, InetAddress localAddr, int loc
475445 host , port , localAddr , localPort );
476446 s .setNpnProtocols (mNpnProtocols );
477447 s .setHandshakeTimeout (mHandshakeTimeoutMillis );
478- s .setSoWriteTimeout (mWriteTimeoutMillis );
479448 if (mSecure ) {
480449 verifyHostname (s , host );
481450 }
@@ -493,7 +462,6 @@ public Socket createSocket(String host, int port) throws IOException {
493462 OpenSSLSocketImpl s = (OpenSSLSocketImpl ) getDelegate ().createSocket (host , port );
494463 s .setNpnProtocols (mNpnProtocols );
495464 s .setHandshakeTimeout (mHandshakeTimeoutMillis );
496- s .setSoWriteTimeout (mWriteTimeoutMillis );
497465 if (mSecure ) {
498466 verifyHostname (s , host );
499467 }
0 commit comments