hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1530010 [32/38] - in /httpcomponents/site: ./ httpcomponents-asyncclient-4.0.x/ httpcomponents-client-4.2.x/ httpcomponents-client-4.3.x/ httpcomponents-client-4.3.x/fluent-hc/ httpcomponents-client-4.3.x/fluent-hc/apidocs/ httpcomponents-...
Date Mon, 07 Oct 2013 17:52:46 GMT
Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/SSLSocketFactory.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/SSLSocketFactory.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/SSLSocketFactory.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/SSLSocketFactory.html Mon Oct  7 17:52:27 2013
@@ -371,214 +371,211 @@
 <a class="jxr_linenumber" name="361" href="#361">361</a>             <strong class="jxr_keyword">final</strong> String[] supportedProtocols,
 <a class="jxr_linenumber" name="362" href="#362">362</a>             <strong class="jxr_keyword">final</strong> String[] supportedCipherSuites,
 <a class="jxr_linenumber" name="363" href="#363">363</a>             <strong class="jxr_keyword">final</strong> <a href="../../../../../org/apache/http/conn/ssl/X509HostnameVerifier.html">X509HostnameVerifier</a> hostnameVerifier) {
-<a class="jxr_linenumber" name="364" href="#364">364</a>         Args.notNull(socketfactory, <span class="jxr_string">"SSL socket factory"</span>);
-<a class="jxr_linenumber" name="365" href="#365">365</a>         <strong class="jxr_keyword">this</strong>.socketfactory = socketfactory;
-<a class="jxr_linenumber" name="366" href="#366">366</a>         <strong class="jxr_keyword">this</strong>.supportedProtocols = supportedProtocols;
-<a class="jxr_linenumber" name="367" href="#367">367</a>         <strong class="jxr_keyword">this</strong>.supportedCipherSuites = supportedCipherSuites;
-<a class="jxr_linenumber" name="368" href="#368">368</a>         <strong class="jxr_keyword">this</strong>.hostnameVerifier = hostnameVerifier;
-<a class="jxr_linenumber" name="369" href="#369">369</a>         <strong class="jxr_keyword">this</strong>.nameResolver = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="370" href="#370">370</a>     }
-<a class="jxr_linenumber" name="371" href="#371">371</a> 
-<a class="jxr_linenumber" name="372" href="#372">372</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="373" href="#373">373</a> <em class="jxr_javadoccomment">     * @param params Optional parameters. Parameters passed to this method will have no effect.</em>
-<a class="jxr_linenumber" name="374" href="#374">374</a> <em class="jxr_javadoccomment">     *               This method will create a unconnected instance of {@link Socket} class.</em>
-<a class="jxr_linenumber" name="375" href="#375">375</a> <em class="jxr_javadoccomment">     * @since 4.1</em>
-<a class="jxr_linenumber" name="376" href="#376">376</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="377" href="#377">377</a>     <strong class="jxr_keyword">public</strong> Socket createSocket(<strong class="jxr_keyword">final</strong> HttpParams params) <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="378" href="#378">378</a>         <strong class="jxr_keyword">return</strong> createSocket((HttpContext) <strong class="jxr_keyword">null</strong>);
-<a class="jxr_linenumber" name="379" href="#379">379</a>     }
-<a class="jxr_linenumber" name="380" href="#380">380</a> 
-<a class="jxr_linenumber" name="381" href="#381">381</a>     <strong class="jxr_keyword">public</strong> Socket createSocket() <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="382" href="#382">382</a>         <strong class="jxr_keyword">return</strong> createSocket((HttpContext) <strong class="jxr_keyword">null</strong>);
-<a class="jxr_linenumber" name="383" href="#383">383</a>     }
-<a class="jxr_linenumber" name="384" href="#384">384</a> 
-<a class="jxr_linenumber" name="385" href="#385">385</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="386" href="#386">386</a> <em class="jxr_javadoccomment">     * @since 4.1</em>
-<a class="jxr_linenumber" name="387" href="#387">387</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="388" href="#388">388</a>     <strong class="jxr_keyword">public</strong> Socket connectSocket(
-<a class="jxr_linenumber" name="389" href="#389">389</a>             <strong class="jxr_keyword">final</strong> Socket socket,
-<a class="jxr_linenumber" name="390" href="#390">390</a>             <strong class="jxr_keyword">final</strong> InetSocketAddress remoteAddress,
-<a class="jxr_linenumber" name="391" href="#391">391</a>             <strong class="jxr_keyword">final</strong> InetSocketAddress localAddress,
-<a class="jxr_linenumber" name="392" href="#392">392</a>             <strong class="jxr_keyword">final</strong> HttpParams params) <strong class="jxr_keyword">throws</strong> IOException, UnknownHostException, ConnectTimeoutException {
-<a class="jxr_linenumber" name="393" href="#393">393</a>         Args.notNull(remoteAddress, <span class="jxr_string">"Remote address"</span>);
-<a class="jxr_linenumber" name="394" href="#394">394</a>         Args.notNull(params, <span class="jxr_string">"HTTP parameters"</span>);
-<a class="jxr_linenumber" name="395" href="#395">395</a>         <strong class="jxr_keyword">final</strong> HttpHost host;
-<a class="jxr_linenumber" name="396" href="#396">396</a>         <strong class="jxr_keyword">if</strong> (remoteAddress instanceof HttpInetSocketAddress) {
-<a class="jxr_linenumber" name="397" href="#397">397</a>             host = ((HttpInetSocketAddress) remoteAddress).getHttpHost();
-<a class="jxr_linenumber" name="398" href="#398">398</a>         } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="399" href="#399">399</a>             host = <strong class="jxr_keyword">new</strong> HttpHost(remoteAddress.getHostName(), remoteAddress.getPort(), <span class="jxr_string">"https"</span>);
-<a class="jxr_linenumber" name="400" href="#400">400</a>         }
-<a class="jxr_linenumber" name="401" href="#401">401</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> connectTimeout = HttpConnectionParams.getConnectionTimeout(params);
-<a class="jxr_linenumber" name="402" href="#402">402</a>         <strong class="jxr_keyword">return</strong> connectSocket(connectTimeout, socket, host, remoteAddress, localAddress, <strong class="jxr_keyword">null</strong>);
-<a class="jxr_linenumber" name="403" href="#403">403</a>     }
-<a class="jxr_linenumber" name="404" href="#404">404</a> 
-<a class="jxr_linenumber" name="405" href="#405">405</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="406" href="#406">406</a> <em class="jxr_javadoccomment">     * Checks whether a socket connection is secure.</em>
-<a class="jxr_linenumber" name="407" href="#407">407</a> <em class="jxr_javadoccomment">     * This factory creates TLS/SSL socket connections</em>
-<a class="jxr_linenumber" name="408" href="#408">408</a> <em class="jxr_javadoccomment">     * which, by default, are considered secure.</em>
-<a class="jxr_linenumber" name="409" href="#409">409</a> <em class="jxr_javadoccomment">     * &lt;br/&gt;</em>
-<a class="jxr_linenumber" name="410" href="#410">410</a> <em class="jxr_javadoccomment">     * Derived classes may override this method to perform</em>
-<a class="jxr_linenumber" name="411" href="#411">411</a> <em class="jxr_javadoccomment">     * runtime checks, for example based on the cypher suite.</em>
-<a class="jxr_linenumber" name="412" href="#412">412</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="413" href="#413">413</a> <em class="jxr_javadoccomment">     * @param sock      the connected socket</em>
-<a class="jxr_linenumber" name="414" href="#414">414</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="415" href="#415">415</a> <em class="jxr_javadoccomment">     * @return  &lt;code&gt;true&lt;/code&gt;</em>
-<a class="jxr_linenumber" name="416" href="#416">416</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="417" href="#417">417</a> <em class="jxr_javadoccomment">     * @throws IllegalArgumentException if the argument is invalid</em>
-<a class="jxr_linenumber" name="418" href="#418">418</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="419" href="#419">419</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isSecure(<strong class="jxr_keyword">final</strong> Socket sock) <strong class="jxr_keyword">throws</strong> IllegalArgumentException {
-<a class="jxr_linenumber" name="420" href="#420">420</a>         Args.notNull(sock, <span class="jxr_string">"Socket"</span>);
-<a class="jxr_linenumber" name="421" href="#421">421</a>         Asserts.check(sock instanceof SSLSocket, <span class="jxr_string">"Socket not created by this factory"</span>);
-<a class="jxr_linenumber" name="422" href="#422">422</a>         Asserts.check(!sock.isClosed(), <span class="jxr_string">"Socket is closed"</span>);
-<a class="jxr_linenumber" name="423" href="#423">423</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
-<a class="jxr_linenumber" name="424" href="#424">424</a>     }
-<a class="jxr_linenumber" name="425" href="#425">425</a> 
-<a class="jxr_linenumber" name="426" href="#426">426</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="427" href="#427">427</a> <em class="jxr_javadoccomment">     * @since 4.2</em>
-<a class="jxr_linenumber" name="428" href="#428">428</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="429" href="#429">429</a>     <strong class="jxr_keyword">public</strong> Socket createLayeredSocket(
-<a class="jxr_linenumber" name="430" href="#430">430</a>         <strong class="jxr_keyword">final</strong> Socket socket,
-<a class="jxr_linenumber" name="431" href="#431">431</a>         <strong class="jxr_keyword">final</strong> String host,
-<a class="jxr_linenumber" name="432" href="#432">432</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> port,
-<a class="jxr_linenumber" name="433" href="#433">433</a>         <strong class="jxr_keyword">final</strong> HttpParams params) <strong class="jxr_keyword">throws</strong> IOException, UnknownHostException {
-<a class="jxr_linenumber" name="434" href="#434">434</a>         <strong class="jxr_keyword">return</strong> createLayeredSocket(socket, host, port, (HttpContext) <strong class="jxr_keyword">null</strong>);
-<a class="jxr_linenumber" name="435" href="#435">435</a>     }
-<a class="jxr_linenumber" name="436" href="#436">436</a> 
-<a class="jxr_linenumber" name="437" href="#437">437</a>     <strong class="jxr_keyword">public</strong> Socket createLayeredSocket(
-<a class="jxr_linenumber" name="438" href="#438">438</a>         <strong class="jxr_keyword">final</strong> Socket socket,
-<a class="jxr_linenumber" name="439" href="#439">439</a>         <strong class="jxr_keyword">final</strong> String host,
-<a class="jxr_linenumber" name="440" href="#440">440</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> port,
-<a class="jxr_linenumber" name="441" href="#441">441</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> autoClose) <strong class="jxr_keyword">throws</strong> IOException, UnknownHostException {
-<a class="jxr_linenumber" name="442" href="#442">442</a>         <strong class="jxr_keyword">return</strong> createLayeredSocket(socket, host, port, (HttpContext) <strong class="jxr_keyword">null</strong>);
-<a class="jxr_linenumber" name="443" href="#443">443</a>     }
-<a class="jxr_linenumber" name="444" href="#444">444</a> 
-<a class="jxr_linenumber" name="445" href="#445">445</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> setHostnameVerifier(<strong class="jxr_keyword">final</strong> <a href="../../../../../org/apache/http/conn/ssl/X509HostnameVerifier.html">X509HostnameVerifier</a> hostnameVerifier) {
-<a class="jxr_linenumber" name="446" href="#446">446</a>         Args.notNull(hostnameVerifier, <span class="jxr_string">"Hostname verifier"</span>);
-<a class="jxr_linenumber" name="447" href="#447">447</a>         <strong class="jxr_keyword">this</strong>.hostnameVerifier = hostnameVerifier;
-<a class="jxr_linenumber" name="448" href="#448">448</a>     }
-<a class="jxr_linenumber" name="449" href="#449">449</a> 
-<a class="jxr_linenumber" name="450" href="#450">450</a>     <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/http/conn/ssl/X509HostnameVerifier.html">X509HostnameVerifier</a> getHostnameVerifier() {
-<a class="jxr_linenumber" name="451" href="#451">451</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">this</strong>.hostnameVerifier;
-<a class="jxr_linenumber" name="452" href="#452">452</a>     }
-<a class="jxr_linenumber" name="453" href="#453">453</a> 
-<a class="jxr_linenumber" name="454" href="#454">454</a>     <strong class="jxr_keyword">public</strong> Socket connectSocket(
-<a class="jxr_linenumber" name="455" href="#455">455</a>             <strong class="jxr_keyword">final</strong> Socket socket,
-<a class="jxr_linenumber" name="456" href="#456">456</a>             <strong class="jxr_keyword">final</strong> String host, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> port,
-<a class="jxr_linenumber" name="457" href="#457">457</a>             <strong class="jxr_keyword">final</strong> InetAddress local, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> localPort,
-<a class="jxr_linenumber" name="458" href="#458">458</a>             <strong class="jxr_keyword">final</strong> HttpParams params) <strong class="jxr_keyword">throws</strong> IOException, UnknownHostException, ConnectTimeoutException {
-<a class="jxr_linenumber" name="459" href="#459">459</a>         <strong class="jxr_keyword">final</strong> InetAddress remote;
-<a class="jxr_linenumber" name="460" href="#460">460</a>         <strong class="jxr_keyword">if</strong> (<strong class="jxr_keyword">this</strong>.nameResolver != <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="461" href="#461">461</a>             remote = <strong class="jxr_keyword">this</strong>.nameResolver.resolve(host);
-<a class="jxr_linenumber" name="462" href="#462">462</a>         } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="463" href="#463">463</a>             remote = InetAddress.getByName(host);
-<a class="jxr_linenumber" name="464" href="#464">464</a>         }
-<a class="jxr_linenumber" name="465" href="#465">465</a>         InetSocketAddress localAddress = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="466" href="#466">466</a>         <strong class="jxr_keyword">if</strong> (local != <strong class="jxr_keyword">null</strong> || localPort &gt; 0) {
-<a class="jxr_linenumber" name="467" href="#467">467</a>             localAddress = <strong class="jxr_keyword">new</strong> InetSocketAddress(local, localPort &gt; 0 ? localPort : 0);
-<a class="jxr_linenumber" name="468" href="#468">468</a>         }
-<a class="jxr_linenumber" name="469" href="#469">469</a>         <strong class="jxr_keyword">final</strong> InetSocketAddress remoteAddress = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/http/conn/HttpInetSocketAddress.html">HttpInetSocketAddress</a>(
-<a class="jxr_linenumber" name="470" href="#470">470</a>                 <strong class="jxr_keyword">new</strong> HttpHost(host, port), remote, port);
-<a class="jxr_linenumber" name="471" href="#471">471</a>         <strong class="jxr_keyword">return</strong> connectSocket(socket, remoteAddress, localAddress, params);
-<a class="jxr_linenumber" name="472" href="#472">472</a>     }
-<a class="jxr_linenumber" name="473" href="#473">473</a> 
-<a class="jxr_linenumber" name="474" href="#474">474</a>     <strong class="jxr_keyword">public</strong> Socket createSocket(
-<a class="jxr_linenumber" name="475" href="#475">475</a>             <strong class="jxr_keyword">final</strong> Socket socket,
-<a class="jxr_linenumber" name="476" href="#476">476</a>             <strong class="jxr_keyword">final</strong> String host, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> port,
-<a class="jxr_linenumber" name="477" href="#477">477</a>             <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> autoClose) <strong class="jxr_keyword">throws</strong> IOException, UnknownHostException {
-<a class="jxr_linenumber" name="478" href="#478">478</a>         <strong class="jxr_keyword">return</strong> createLayeredSocket(socket, host, port, autoClose);
-<a class="jxr_linenumber" name="479" href="#479">479</a>     }
-<a class="jxr_linenumber" name="480" href="#480">480</a> 
-<a class="jxr_linenumber" name="481" href="#481">481</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="482" href="#482">482</a> <em class="jxr_javadoccomment">     * Performs any custom initialization for a newly created SSLSocket</em>
-<a class="jxr_linenumber" name="483" href="#483">483</a> <em class="jxr_javadoccomment">     * (before the SSL handshake happens).</em>
-<a class="jxr_linenumber" name="484" href="#484">484</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="485" href="#485">485</a> <em class="jxr_javadoccomment">     * The default implementation is a no-op, but could be overriden to, e.g.,</em>
-<a class="jxr_linenumber" name="486" href="#486">486</a> <em class="jxr_javadoccomment">     * call {@link SSLSocket#setEnabledCipherSuites(java.lang.String[])}.</em>
-<a class="jxr_linenumber" name="487" href="#487">487</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="488" href="#488">488</a> <em class="jxr_javadoccomment">     * @since 4.2</em>
-<a class="jxr_linenumber" name="489" href="#489">489</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="490" href="#490">490</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> prepareSocket(<strong class="jxr_keyword">final</strong> SSLSocket socket) <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="491" href="#491">491</a>     }
-<a class="jxr_linenumber" name="492" href="#492">492</a> 
-<a class="jxr_linenumber" name="493" href="#493">493</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> internalPrepareSocket(<strong class="jxr_keyword">final</strong> SSLSocket socket) <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="494" href="#494">494</a>         <strong class="jxr_keyword">if</strong> (supportedProtocols != <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="495" href="#495">495</a>             socket.setEnabledProtocols(supportedProtocols);
-<a class="jxr_linenumber" name="496" href="#496">496</a>         }
-<a class="jxr_linenumber" name="497" href="#497">497</a>         <strong class="jxr_keyword">if</strong> (supportedCipherSuites != <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="498" href="#498">498</a>             socket.setEnabledCipherSuites(supportedCipherSuites);
-<a class="jxr_linenumber" name="499" href="#499">499</a>         }
-<a class="jxr_linenumber" name="500" href="#500">500</a>         prepareSocket(socket);
-<a class="jxr_linenumber" name="501" href="#501">501</a>     }
-<a class="jxr_linenumber" name="502" href="#502">502</a> 
-<a class="jxr_linenumber" name="503" href="#503">503</a>     <strong class="jxr_keyword">public</strong> Socket createSocket(<strong class="jxr_keyword">final</strong> HttpContext context) <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="504" href="#504">504</a>         <strong class="jxr_keyword">final</strong> SSLSocket sock = (SSLSocket) <strong class="jxr_keyword">this</strong>.socketfactory.createSocket();
-<a class="jxr_linenumber" name="505" href="#505">505</a>         internalPrepareSocket(sock);
-<a class="jxr_linenumber" name="506" href="#506">506</a>         <strong class="jxr_keyword">return</strong> sock;
-<a class="jxr_linenumber" name="507" href="#507">507</a>     }
-<a class="jxr_linenumber" name="508" href="#508">508</a> 
-<a class="jxr_linenumber" name="509" href="#509">509</a>     <strong class="jxr_keyword">public</strong> Socket connectSocket(
-<a class="jxr_linenumber" name="510" href="#510">510</a>             <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> connectTimeout,
-<a class="jxr_linenumber" name="511" href="#511">511</a>             <strong class="jxr_keyword">final</strong> Socket socket,
-<a class="jxr_linenumber" name="512" href="#512">512</a>             <strong class="jxr_keyword">final</strong> HttpHost host,
-<a class="jxr_linenumber" name="513" href="#513">513</a>             <strong class="jxr_keyword">final</strong> InetSocketAddress remoteAddress,
-<a class="jxr_linenumber" name="514" href="#514">514</a>             <strong class="jxr_keyword">final</strong> InetSocketAddress localAddress,
-<a class="jxr_linenumber" name="515" href="#515">515</a>             <strong class="jxr_keyword">final</strong> HttpContext context) <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="516" href="#516">516</a>         Args.notNull(host, <span class="jxr_string">"HTTP host"</span>);
-<a class="jxr_linenumber" name="517" href="#517">517</a>         Args.notNull(remoteAddress, <span class="jxr_string">"Remote address"</span>);
-<a class="jxr_linenumber" name="518" href="#518">518</a>         <strong class="jxr_keyword">final</strong> Socket sock = socket != <strong class="jxr_keyword">null</strong> ? socket : createSocket(context);
-<a class="jxr_linenumber" name="519" href="#519">519</a>         <strong class="jxr_keyword">if</strong> (localAddress != <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="520" href="#520">520</a>             sock.bind(localAddress);
-<a class="jxr_linenumber" name="521" href="#521">521</a>         }
-<a class="jxr_linenumber" name="522" href="#522">522</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="523" href="#523">523</a>             sock.connect(remoteAddress, connectTimeout);
-<a class="jxr_linenumber" name="524" href="#524">524</a>         } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> IOException ex) {
-<a class="jxr_linenumber" name="525" href="#525">525</a>             <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="526" href="#526">526</a>                 sock.close();
-<a class="jxr_linenumber" name="527" href="#527">527</a>             } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> IOException ignore) {
-<a class="jxr_linenumber" name="528" href="#528">528</a>             }
-<a class="jxr_linenumber" name="529" href="#529">529</a>             <strong class="jxr_keyword">throw</strong> ex;
-<a class="jxr_linenumber" name="530" href="#530">530</a>         }
-<a class="jxr_linenumber" name="531" href="#531">531</a>         <em class="jxr_comment">// Setup SSL layering if necessary</em>
-<a class="jxr_linenumber" name="532" href="#532">532</a>         <strong class="jxr_keyword">if</strong> (sock instanceof SSLSocket) {
-<a class="jxr_linenumber" name="533" href="#533">533</a>             <strong class="jxr_keyword">final</strong> SSLSocket sslsock = (SSLSocket) sock;
-<a class="jxr_linenumber" name="534" href="#534">534</a>             sslsock.startHandshake();
-<a class="jxr_linenumber" name="535" href="#535">535</a>             verifyHostname(sslsock, host.getHostName());
-<a class="jxr_linenumber" name="536" href="#536">536</a>             <strong class="jxr_keyword">return</strong> sock;
-<a class="jxr_linenumber" name="537" href="#537">537</a>         } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="538" href="#538">538</a>             <strong class="jxr_keyword">return</strong> createLayeredSocket(sock, host.getHostName(), remoteAddress.getPort(), context);
-<a class="jxr_linenumber" name="539" href="#539">539</a>         }
-<a class="jxr_linenumber" name="540" href="#540">540</a>     }
-<a class="jxr_linenumber" name="541" href="#541">541</a> 
-<a class="jxr_linenumber" name="542" href="#542">542</a>     <strong class="jxr_keyword">public</strong> Socket createLayeredSocket(
-<a class="jxr_linenumber" name="543" href="#543">543</a>             <strong class="jxr_keyword">final</strong> Socket socket,
-<a class="jxr_linenumber" name="544" href="#544">544</a>             <strong class="jxr_keyword">final</strong> String target,
-<a class="jxr_linenumber" name="545" href="#545">545</a>             <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> port,
-<a class="jxr_linenumber" name="546" href="#546">546</a>             <strong class="jxr_keyword">final</strong> HttpContext context) <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="547" href="#547">547</a>         <strong class="jxr_keyword">final</strong> SSLSocket sslsock = (SSLSocket) <strong class="jxr_keyword">this</strong>.socketfactory.createSocket(
-<a class="jxr_linenumber" name="548" href="#548">548</a>                 socket,
-<a class="jxr_linenumber" name="549" href="#549">549</a>                 target,
-<a class="jxr_linenumber" name="550" href="#550">550</a>                 port,
-<a class="jxr_linenumber" name="551" href="#551">551</a>                 <strong class="jxr_keyword">true</strong>);
-<a class="jxr_linenumber" name="552" href="#552">552</a>         internalPrepareSocket(sslsock);
-<a class="jxr_linenumber" name="553" href="#553">553</a>         sslsock.startHandshake();
-<a class="jxr_linenumber" name="554" href="#554">554</a>         verifyHostname(sslsock, target);
-<a class="jxr_linenumber" name="555" href="#555">555</a>         <strong class="jxr_keyword">return</strong> sslsock;
-<a class="jxr_linenumber" name="556" href="#556">556</a>     }
-<a class="jxr_linenumber" name="557" href="#557">557</a> 
-<a class="jxr_linenumber" name="558" href="#558">558</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> verifyHostname(<strong class="jxr_keyword">final</strong> SSLSocket sslsock, <strong class="jxr_keyword">final</strong> String hostname) <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="559" href="#559">559</a>         <strong class="jxr_keyword">if</strong> (<strong class="jxr_keyword">this</strong>.hostnameVerifier != <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="560" href="#560">560</a>             <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="561" href="#561">561</a>                 <strong class="jxr_keyword">this</strong>.hostnameVerifier.verify(hostname, sslsock);
-<a class="jxr_linenumber" name="562" href="#562">562</a>                 <em class="jxr_comment">// verifyHostName() didn't blowup - good!</em>
-<a class="jxr_linenumber" name="563" href="#563">563</a>             } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> IOException iox) {
-<a class="jxr_linenumber" name="564" href="#564">564</a>                 <em class="jxr_comment">// close the socket before re-throwing the exception</em>
-<a class="jxr_linenumber" name="565" href="#565">565</a>                 <strong class="jxr_keyword">try</strong> { sslsock.close(); } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> Exception x) { <em class="jxr_comment">/*<em class="jxr_comment">ignore*/</em> }</em>
-<a class="jxr_linenumber" name="566" href="#566">566</a>                 <strong class="jxr_keyword">throw</strong> iox;
-<a class="jxr_linenumber" name="567" href="#567">567</a>             }
-<a class="jxr_linenumber" name="568" href="#568">568</a>         }
-<a class="jxr_linenumber" name="569" href="#569">569</a>     }
-<a class="jxr_linenumber" name="570" href="#570">570</a> 
-<a class="jxr_linenumber" name="571" href="#571">571</a> }
+<a class="jxr_linenumber" name="364" href="#364">364</a>         <strong class="jxr_keyword">this</strong>.socketfactory = Args.notNull(socketfactory, <span class="jxr_string">"SSL socket factory"</span>);
+<a class="jxr_linenumber" name="365" href="#365">365</a>         <strong class="jxr_keyword">this</strong>.supportedProtocols = supportedProtocols;
+<a class="jxr_linenumber" name="366" href="#366">366</a>         <strong class="jxr_keyword">this</strong>.supportedCipherSuites = supportedCipherSuites;
+<a class="jxr_linenumber" name="367" href="#367">367</a>         <strong class="jxr_keyword">this</strong>.hostnameVerifier = hostnameVerifier != <strong class="jxr_keyword">null</strong> ? hostnameVerifier : BROWSER_COMPATIBLE_HOSTNAME_VERIFIER;
+<a class="jxr_linenumber" name="368" href="#368">368</a>         <strong class="jxr_keyword">this</strong>.nameResolver = <strong class="jxr_keyword">null</strong>;
+<a class="jxr_linenumber" name="369" href="#369">369</a>     }
+<a class="jxr_linenumber" name="370" href="#370">370</a> 
+<a class="jxr_linenumber" name="371" href="#371">371</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="372" href="#372">372</a> <em class="jxr_javadoccomment">     * @param params Optional parameters. Parameters passed to this method will have no effect.</em>
+<a class="jxr_linenumber" name="373" href="#373">373</a> <em class="jxr_javadoccomment">     *               This method will create a unconnected instance of {@link Socket} class.</em>
+<a class="jxr_linenumber" name="374" href="#374">374</a> <em class="jxr_javadoccomment">     * @since 4.1</em>
+<a class="jxr_linenumber" name="375" href="#375">375</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="376" href="#376">376</a>     <strong class="jxr_keyword">public</strong> Socket createSocket(<strong class="jxr_keyword">final</strong> HttpParams params) <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="377" href="#377">377</a>         <strong class="jxr_keyword">return</strong> createSocket((HttpContext) <strong class="jxr_keyword">null</strong>);
+<a class="jxr_linenumber" name="378" href="#378">378</a>     }
+<a class="jxr_linenumber" name="379" href="#379">379</a> 
+<a class="jxr_linenumber" name="380" href="#380">380</a>     <strong class="jxr_keyword">public</strong> Socket createSocket() <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="381" href="#381">381</a>         <strong class="jxr_keyword">return</strong> createSocket((HttpContext) <strong class="jxr_keyword">null</strong>);
+<a class="jxr_linenumber" name="382" href="#382">382</a>     }
+<a class="jxr_linenumber" name="383" href="#383">383</a> 
+<a class="jxr_linenumber" name="384" href="#384">384</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="385" href="#385">385</a> <em class="jxr_javadoccomment">     * @since 4.1</em>
+<a class="jxr_linenumber" name="386" href="#386">386</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="387" href="#387">387</a>     <strong class="jxr_keyword">public</strong> Socket connectSocket(
+<a class="jxr_linenumber" name="388" href="#388">388</a>             <strong class="jxr_keyword">final</strong> Socket socket,
+<a class="jxr_linenumber" name="389" href="#389">389</a>             <strong class="jxr_keyword">final</strong> InetSocketAddress remoteAddress,
+<a class="jxr_linenumber" name="390" href="#390">390</a>             <strong class="jxr_keyword">final</strong> InetSocketAddress localAddress,
+<a class="jxr_linenumber" name="391" href="#391">391</a>             <strong class="jxr_keyword">final</strong> HttpParams params) <strong class="jxr_keyword">throws</strong> IOException, UnknownHostException, ConnectTimeoutException {
+<a class="jxr_linenumber" name="392" href="#392">392</a>         Args.notNull(remoteAddress, <span class="jxr_string">"Remote address"</span>);
+<a class="jxr_linenumber" name="393" href="#393">393</a>         Args.notNull(params, <span class="jxr_string">"HTTP parameters"</span>);
+<a class="jxr_linenumber" name="394" href="#394">394</a>         <strong class="jxr_keyword">final</strong> HttpHost host;
+<a class="jxr_linenumber" name="395" href="#395">395</a>         <strong class="jxr_keyword">if</strong> (remoteAddress instanceof HttpInetSocketAddress) {
+<a class="jxr_linenumber" name="396" href="#396">396</a>             host = ((HttpInetSocketAddress) remoteAddress).getHttpHost();
+<a class="jxr_linenumber" name="397" href="#397">397</a>         } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="398" href="#398">398</a>             host = <strong class="jxr_keyword">new</strong> HttpHost(remoteAddress.getHostName(), remoteAddress.getPort(), <span class="jxr_string">"https"</span>);
+<a class="jxr_linenumber" name="399" href="#399">399</a>         }
+<a class="jxr_linenumber" name="400" href="#400">400</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> connectTimeout = HttpConnectionParams.getConnectionTimeout(params);
+<a class="jxr_linenumber" name="401" href="#401">401</a>         <strong class="jxr_keyword">return</strong> connectSocket(connectTimeout, socket, host, remoteAddress, localAddress, <strong class="jxr_keyword">null</strong>);
+<a class="jxr_linenumber" name="402" href="#402">402</a>     }
+<a class="jxr_linenumber" name="403" href="#403">403</a> 
+<a class="jxr_linenumber" name="404" href="#404">404</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="405" href="#405">405</a> <em class="jxr_javadoccomment">     * Checks whether a socket connection is secure.</em>
+<a class="jxr_linenumber" name="406" href="#406">406</a> <em class="jxr_javadoccomment">     * This factory creates TLS/SSL socket connections</em>
+<a class="jxr_linenumber" name="407" href="#407">407</a> <em class="jxr_javadoccomment">     * which, by default, are considered secure.</em>
+<a class="jxr_linenumber" name="408" href="#408">408</a> <em class="jxr_javadoccomment">     * &lt;br/&gt;</em>
+<a class="jxr_linenumber" name="409" href="#409">409</a> <em class="jxr_javadoccomment">     * Derived classes may override this method to perform</em>
+<a class="jxr_linenumber" name="410" href="#410">410</a> <em class="jxr_javadoccomment">     * runtime checks, for example based on the cypher suite.</em>
+<a class="jxr_linenumber" name="411" href="#411">411</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="412" href="#412">412</a> <em class="jxr_javadoccomment">     * @param sock      the connected socket</em>
+<a class="jxr_linenumber" name="413" href="#413">413</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="414" href="#414">414</a> <em class="jxr_javadoccomment">     * @return  &lt;code&gt;true&lt;/code&gt;</em>
+<a class="jxr_linenumber" name="415" href="#415">415</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="416" href="#416">416</a> <em class="jxr_javadoccomment">     * @throws IllegalArgumentException if the argument is invalid</em>
+<a class="jxr_linenumber" name="417" href="#417">417</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="418" href="#418">418</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isSecure(<strong class="jxr_keyword">final</strong> Socket sock) <strong class="jxr_keyword">throws</strong> IllegalArgumentException {
+<a class="jxr_linenumber" name="419" href="#419">419</a>         Args.notNull(sock, <span class="jxr_string">"Socket"</span>);
+<a class="jxr_linenumber" name="420" href="#420">420</a>         Asserts.check(sock instanceof SSLSocket, <span class="jxr_string">"Socket not created by this factory"</span>);
+<a class="jxr_linenumber" name="421" href="#421">421</a>         Asserts.check(!sock.isClosed(), <span class="jxr_string">"Socket is closed"</span>);
+<a class="jxr_linenumber" name="422" href="#422">422</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="423" href="#423">423</a>     }
+<a class="jxr_linenumber" name="424" href="#424">424</a> 
+<a class="jxr_linenumber" name="425" href="#425">425</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="426" href="#426">426</a> <em class="jxr_javadoccomment">     * @since 4.2</em>
+<a class="jxr_linenumber" name="427" href="#427">427</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="428" href="#428">428</a>     <strong class="jxr_keyword">public</strong> Socket createLayeredSocket(
+<a class="jxr_linenumber" name="429" href="#429">429</a>         <strong class="jxr_keyword">final</strong> Socket socket,
+<a class="jxr_linenumber" name="430" href="#430">430</a>         <strong class="jxr_keyword">final</strong> String host,
+<a class="jxr_linenumber" name="431" href="#431">431</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> port,
+<a class="jxr_linenumber" name="432" href="#432">432</a>         <strong class="jxr_keyword">final</strong> HttpParams params) <strong class="jxr_keyword">throws</strong> IOException, UnknownHostException {
+<a class="jxr_linenumber" name="433" href="#433">433</a>         <strong class="jxr_keyword">return</strong> createLayeredSocket(socket, host, port, (HttpContext) <strong class="jxr_keyword">null</strong>);
+<a class="jxr_linenumber" name="434" href="#434">434</a>     }
+<a class="jxr_linenumber" name="435" href="#435">435</a> 
+<a class="jxr_linenumber" name="436" href="#436">436</a>     <strong class="jxr_keyword">public</strong> Socket createLayeredSocket(
+<a class="jxr_linenumber" name="437" href="#437">437</a>         <strong class="jxr_keyword">final</strong> Socket socket,
+<a class="jxr_linenumber" name="438" href="#438">438</a>         <strong class="jxr_keyword">final</strong> String host,
+<a class="jxr_linenumber" name="439" href="#439">439</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> port,
+<a class="jxr_linenumber" name="440" href="#440">440</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> autoClose) <strong class="jxr_keyword">throws</strong> IOException, UnknownHostException {
+<a class="jxr_linenumber" name="441" href="#441">441</a>         <strong class="jxr_keyword">return</strong> createLayeredSocket(socket, host, port, (HttpContext) <strong class="jxr_keyword">null</strong>);
+<a class="jxr_linenumber" name="442" href="#442">442</a>     }
+<a class="jxr_linenumber" name="443" href="#443">443</a> 
+<a class="jxr_linenumber" name="444" href="#444">444</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> setHostnameVerifier(<strong class="jxr_keyword">final</strong> <a href="../../../../../org/apache/http/conn/ssl/X509HostnameVerifier.html">X509HostnameVerifier</a> hostnameVerifier) {
+<a class="jxr_linenumber" name="445" href="#445">445</a>         Args.notNull(hostnameVerifier, <span class="jxr_string">"Hostname verifier"</span>);
+<a class="jxr_linenumber" name="446" href="#446">446</a>         <strong class="jxr_keyword">this</strong>.hostnameVerifier = hostnameVerifier;
+<a class="jxr_linenumber" name="447" href="#447">447</a>     }
+<a class="jxr_linenumber" name="448" href="#448">448</a> 
+<a class="jxr_linenumber" name="449" href="#449">449</a>     <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/http/conn/ssl/X509HostnameVerifier.html">X509HostnameVerifier</a> getHostnameVerifier() {
+<a class="jxr_linenumber" name="450" href="#450">450</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">this</strong>.hostnameVerifier;
+<a class="jxr_linenumber" name="451" href="#451">451</a>     }
+<a class="jxr_linenumber" name="452" href="#452">452</a> 
+<a class="jxr_linenumber" name="453" href="#453">453</a>     <strong class="jxr_keyword">public</strong> Socket connectSocket(
+<a class="jxr_linenumber" name="454" href="#454">454</a>             <strong class="jxr_keyword">final</strong> Socket socket,
+<a class="jxr_linenumber" name="455" href="#455">455</a>             <strong class="jxr_keyword">final</strong> String host, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> port,
+<a class="jxr_linenumber" name="456" href="#456">456</a>             <strong class="jxr_keyword">final</strong> InetAddress local, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> localPort,
+<a class="jxr_linenumber" name="457" href="#457">457</a>             <strong class="jxr_keyword">final</strong> HttpParams params) <strong class="jxr_keyword">throws</strong> IOException, UnknownHostException, ConnectTimeoutException {
+<a class="jxr_linenumber" name="458" href="#458">458</a>         <strong class="jxr_keyword">final</strong> InetAddress remote;
+<a class="jxr_linenumber" name="459" href="#459">459</a>         <strong class="jxr_keyword">if</strong> (<strong class="jxr_keyword">this</strong>.nameResolver != <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="460" href="#460">460</a>             remote = <strong class="jxr_keyword">this</strong>.nameResolver.resolve(host);
+<a class="jxr_linenumber" name="461" href="#461">461</a>         } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="462" href="#462">462</a>             remote = InetAddress.getByName(host);
+<a class="jxr_linenumber" name="463" href="#463">463</a>         }
+<a class="jxr_linenumber" name="464" href="#464">464</a>         InetSocketAddress localAddress = <strong class="jxr_keyword">null</strong>;
+<a class="jxr_linenumber" name="465" href="#465">465</a>         <strong class="jxr_keyword">if</strong> (local != <strong class="jxr_keyword">null</strong> || localPort &gt; 0) {
+<a class="jxr_linenumber" name="466" href="#466">466</a>             localAddress = <strong class="jxr_keyword">new</strong> InetSocketAddress(local, localPort &gt; 0 ? localPort : 0);
+<a class="jxr_linenumber" name="467" href="#467">467</a>         }
+<a class="jxr_linenumber" name="468" href="#468">468</a>         <strong class="jxr_keyword">final</strong> InetSocketAddress remoteAddress = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/http/conn/HttpInetSocketAddress.html">HttpInetSocketAddress</a>(
+<a class="jxr_linenumber" name="469" href="#469">469</a>                 <strong class="jxr_keyword">new</strong> HttpHost(host, port), remote, port);
+<a class="jxr_linenumber" name="470" href="#470">470</a>         <strong class="jxr_keyword">return</strong> connectSocket(socket, remoteAddress, localAddress, params);
+<a class="jxr_linenumber" name="471" href="#471">471</a>     }
+<a class="jxr_linenumber" name="472" href="#472">472</a> 
+<a class="jxr_linenumber" name="473" href="#473">473</a>     <strong class="jxr_keyword">public</strong> Socket createSocket(
+<a class="jxr_linenumber" name="474" href="#474">474</a>             <strong class="jxr_keyword">final</strong> Socket socket,
+<a class="jxr_linenumber" name="475" href="#475">475</a>             <strong class="jxr_keyword">final</strong> String host, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> port,
+<a class="jxr_linenumber" name="476" href="#476">476</a>             <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> autoClose) <strong class="jxr_keyword">throws</strong> IOException, UnknownHostException {
+<a class="jxr_linenumber" name="477" href="#477">477</a>         <strong class="jxr_keyword">return</strong> createLayeredSocket(socket, host, port, autoClose);
+<a class="jxr_linenumber" name="478" href="#478">478</a>     }
+<a class="jxr_linenumber" name="479" href="#479">479</a> 
+<a class="jxr_linenumber" name="480" href="#480">480</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="481" href="#481">481</a> <em class="jxr_javadoccomment">     * Performs any custom initialization for a newly created SSLSocket</em>
+<a class="jxr_linenumber" name="482" href="#482">482</a> <em class="jxr_javadoccomment">     * (before the SSL handshake happens).</em>
+<a class="jxr_linenumber" name="483" href="#483">483</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="484" href="#484">484</a> <em class="jxr_javadoccomment">     * The default implementation is a no-op, but could be overriden to, e.g.,</em>
+<a class="jxr_linenumber" name="485" href="#485">485</a> <em class="jxr_javadoccomment">     * call {@link SSLSocket#setEnabledCipherSuites(java.lang.String[])}.</em>
+<a class="jxr_linenumber" name="486" href="#486">486</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="487" href="#487">487</a> <em class="jxr_javadoccomment">     * @since 4.2</em>
+<a class="jxr_linenumber" name="488" href="#488">488</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="489" href="#489">489</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> prepareSocket(<strong class="jxr_keyword">final</strong> SSLSocket socket) <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="490" href="#490">490</a>     }
+<a class="jxr_linenumber" name="491" href="#491">491</a> 
+<a class="jxr_linenumber" name="492" href="#492">492</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> internalPrepareSocket(<strong class="jxr_keyword">final</strong> SSLSocket socket) <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="493" href="#493">493</a>         <strong class="jxr_keyword">if</strong> (supportedProtocols != <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="494" href="#494">494</a>             socket.setEnabledProtocols(supportedProtocols);
+<a class="jxr_linenumber" name="495" href="#495">495</a>         }
+<a class="jxr_linenumber" name="496" href="#496">496</a>         <strong class="jxr_keyword">if</strong> (supportedCipherSuites != <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="497" href="#497">497</a>             socket.setEnabledCipherSuites(supportedCipherSuites);
+<a class="jxr_linenumber" name="498" href="#498">498</a>         }
+<a class="jxr_linenumber" name="499" href="#499">499</a>         prepareSocket(socket);
+<a class="jxr_linenumber" name="500" href="#500">500</a>     }
+<a class="jxr_linenumber" name="501" href="#501">501</a> 
+<a class="jxr_linenumber" name="502" href="#502">502</a>     <strong class="jxr_keyword">public</strong> Socket createSocket(<strong class="jxr_keyword">final</strong> HttpContext context) <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="503" href="#503">503</a>         <strong class="jxr_keyword">final</strong> SSLSocket sock = (SSLSocket) <strong class="jxr_keyword">this</strong>.socketfactory.createSocket();
+<a class="jxr_linenumber" name="504" href="#504">504</a>         internalPrepareSocket(sock);
+<a class="jxr_linenumber" name="505" href="#505">505</a>         <strong class="jxr_keyword">return</strong> sock;
+<a class="jxr_linenumber" name="506" href="#506">506</a>     }
+<a class="jxr_linenumber" name="507" href="#507">507</a> 
+<a class="jxr_linenumber" name="508" href="#508">508</a>     <strong class="jxr_keyword">public</strong> Socket connectSocket(
+<a class="jxr_linenumber" name="509" href="#509">509</a>             <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> connectTimeout,
+<a class="jxr_linenumber" name="510" href="#510">510</a>             <strong class="jxr_keyword">final</strong> Socket socket,
+<a class="jxr_linenumber" name="511" href="#511">511</a>             <strong class="jxr_keyword">final</strong> HttpHost host,
+<a class="jxr_linenumber" name="512" href="#512">512</a>             <strong class="jxr_keyword">final</strong> InetSocketAddress remoteAddress,
+<a class="jxr_linenumber" name="513" href="#513">513</a>             <strong class="jxr_keyword">final</strong> InetSocketAddress localAddress,
+<a class="jxr_linenumber" name="514" href="#514">514</a>             <strong class="jxr_keyword">final</strong> HttpContext context) <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="515" href="#515">515</a>         Args.notNull(host, <span class="jxr_string">"HTTP host"</span>);
+<a class="jxr_linenumber" name="516" href="#516">516</a>         Args.notNull(remoteAddress, <span class="jxr_string">"Remote address"</span>);
+<a class="jxr_linenumber" name="517" href="#517">517</a>         <strong class="jxr_keyword">final</strong> Socket sock = socket != <strong class="jxr_keyword">null</strong> ? socket : createSocket(context);
+<a class="jxr_linenumber" name="518" href="#518">518</a>         <strong class="jxr_keyword">if</strong> (localAddress != <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="519" href="#519">519</a>             sock.bind(localAddress);
+<a class="jxr_linenumber" name="520" href="#520">520</a>         }
+<a class="jxr_linenumber" name="521" href="#521">521</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="522" href="#522">522</a>             sock.connect(remoteAddress, connectTimeout);
+<a class="jxr_linenumber" name="523" href="#523">523</a>         } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> IOException ex) {
+<a class="jxr_linenumber" name="524" href="#524">524</a>             <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="525" href="#525">525</a>                 sock.close();
+<a class="jxr_linenumber" name="526" href="#526">526</a>             } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> IOException ignore) {
+<a class="jxr_linenumber" name="527" href="#527">527</a>             }
+<a class="jxr_linenumber" name="528" href="#528">528</a>             <strong class="jxr_keyword">throw</strong> ex;
+<a class="jxr_linenumber" name="529" href="#529">529</a>         }
+<a class="jxr_linenumber" name="530" href="#530">530</a>         <em class="jxr_comment">// Setup SSL layering if necessary</em>
+<a class="jxr_linenumber" name="531" href="#531">531</a>         <strong class="jxr_keyword">if</strong> (sock instanceof SSLSocket) {
+<a class="jxr_linenumber" name="532" href="#532">532</a>             <strong class="jxr_keyword">final</strong> SSLSocket sslsock = (SSLSocket) sock;
+<a class="jxr_linenumber" name="533" href="#533">533</a>             sslsock.startHandshake();
+<a class="jxr_linenumber" name="534" href="#534">534</a>             verifyHostname(sslsock, host.getHostName());
+<a class="jxr_linenumber" name="535" href="#535">535</a>             <strong class="jxr_keyword">return</strong> sock;
+<a class="jxr_linenumber" name="536" href="#536">536</a>         } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="537" href="#537">537</a>             <strong class="jxr_keyword">return</strong> createLayeredSocket(sock, host.getHostName(), remoteAddress.getPort(), context);
+<a class="jxr_linenumber" name="538" href="#538">538</a>         }
+<a class="jxr_linenumber" name="539" href="#539">539</a>     }
+<a class="jxr_linenumber" name="540" href="#540">540</a> 
+<a class="jxr_linenumber" name="541" href="#541">541</a>     <strong class="jxr_keyword">public</strong> Socket createLayeredSocket(
+<a class="jxr_linenumber" name="542" href="#542">542</a>             <strong class="jxr_keyword">final</strong> Socket socket,
+<a class="jxr_linenumber" name="543" href="#543">543</a>             <strong class="jxr_keyword">final</strong> String target,
+<a class="jxr_linenumber" name="544" href="#544">544</a>             <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> port,
+<a class="jxr_linenumber" name="545" href="#545">545</a>             <strong class="jxr_keyword">final</strong> HttpContext context) <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="546" href="#546">546</a>         <strong class="jxr_keyword">final</strong> SSLSocket sslsock = (SSLSocket) <strong class="jxr_keyword">this</strong>.socketfactory.createSocket(
+<a class="jxr_linenumber" name="547" href="#547">547</a>                 socket,
+<a class="jxr_linenumber" name="548" href="#548">548</a>                 target,
+<a class="jxr_linenumber" name="549" href="#549">549</a>                 port,
+<a class="jxr_linenumber" name="550" href="#550">550</a>                 <strong class="jxr_keyword">true</strong>);
+<a class="jxr_linenumber" name="551" href="#551">551</a>         internalPrepareSocket(sslsock);
+<a class="jxr_linenumber" name="552" href="#552">552</a>         sslsock.startHandshake();
+<a class="jxr_linenumber" name="553" href="#553">553</a>         verifyHostname(sslsock, target);
+<a class="jxr_linenumber" name="554" href="#554">554</a>         <strong class="jxr_keyword">return</strong> sslsock;
+<a class="jxr_linenumber" name="555" href="#555">555</a>     }
+<a class="jxr_linenumber" name="556" href="#556">556</a> 
+<a class="jxr_linenumber" name="557" href="#557">557</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> verifyHostname(<strong class="jxr_keyword">final</strong> SSLSocket sslsock, <strong class="jxr_keyword">final</strong> String hostname) <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="558" href="#558">558</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="559" href="#559">559</a>             <strong class="jxr_keyword">this</strong>.hostnameVerifier.verify(hostname, sslsock);
+<a class="jxr_linenumber" name="560" href="#560">560</a>             <em class="jxr_comment">// verifyHostName() didn't blowup - good!</em>
+<a class="jxr_linenumber" name="561" href="#561">561</a>         } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> IOException iox) {
+<a class="jxr_linenumber" name="562" href="#562">562</a>             <em class="jxr_comment">// close the socket before re-throwing the exception</em>
+<a class="jxr_linenumber" name="563" href="#563">563</a>             <strong class="jxr_keyword">try</strong> { sslsock.close(); } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> Exception x) { <em class="jxr_comment">/*<em class="jxr_comment">ignore*/</em> }</em>
+<a class="jxr_linenumber" name="564" href="#564">564</a>             <strong class="jxr_keyword">throw</strong> iox;
+<a class="jxr_linenumber" name="565" href="#565">565</a>         }
+<a class="jxr_linenumber" name="566" href="#566">566</a>     }
+<a class="jxr_linenumber" name="567" href="#567">567</a> 
+<a class="jxr_linenumber" name="568" href="#568">568</a> }
 </pre>
 <hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
 </html>

Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/package-frame.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/package-frame.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/package-frame.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/package-frame.html Mon Oct  7 17:52:27 2013
@@ -3,7 +3,7 @@
 <html xml:lang="en" lang="en">
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-		<title>Apache HttpClient 4.3 Reference Package org.apache.http.conn.ssl</title>
+		<title>Apache HttpClient 4.3.1 Reference Package org.apache.http.conn.ssl</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/package-summary.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/package-summary.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/package-summary.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/package-summary.html Mon Oct  7 17:52:27 2013
@@ -3,7 +3,7 @@
 <html xml:lang="en" lang="en">
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-		<title>Apache HttpClient 4.3 Reference Package org.apache.http.conn.ssl</title>
+		<title>Apache HttpClient 4.3.1 Reference Package org.apache.http.conn.ssl</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/util/package-frame.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/util/package-frame.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/util/package-frame.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/util/package-frame.html Mon Oct  7 17:52:27 2013
@@ -3,7 +3,7 @@
 <html xml:lang="en" lang="en">
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-		<title>Apache HttpClient 4.3 Reference Package org.apache.http.conn.util</title>
+		<title>Apache HttpClient 4.3.1 Reference Package org.apache.http.conn.util</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/util/package-summary.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/util/package-summary.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/util/package-summary.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/util/package-summary.html Mon Oct  7 17:52:27 2013
@@ -3,7 +3,7 @@
 <html xml:lang="en" lang="en">
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-		<title>Apache HttpClient 4.3 Reference Package org.apache.http.conn.util</title>
+		<title>Apache HttpClient 4.3.1 Reference Package org.apache.http.conn.util</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/package-frame.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/package-frame.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/package-frame.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/package-frame.html Mon Oct  7 17:52:27 2013
@@ -3,7 +3,7 @@
 <html xml:lang="en" lang="en">
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-		<title>Apache HttpClient 4.3 Reference Package org.apache.http.cookie</title>
+		<title>Apache HttpClient 4.3.1 Reference Package org.apache.http.cookie</title>
 		<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/package-summary.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/package-summary.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/package-summary.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/package-summary.html Mon Oct  7 17:52:27 2013
@@ -3,7 +3,7 @@
 <html xml:lang="en" lang="en">
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-		<title>Apache HttpClient 4.3 Reference Package org.apache.http.cookie</title>
+		<title>Apache HttpClient 4.3.1 Reference Package org.apache.http.cookie</title>
 		<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/params/package-frame.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/params/package-frame.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/params/package-frame.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/params/package-frame.html Mon Oct  7 17:52:27 2013
@@ -3,7 +3,7 @@
 <html xml:lang="en" lang="en">
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-		<title>Apache HttpClient 4.3 Reference Package org.apache.http.cookie.params</title>
+		<title>Apache HttpClient 4.3.1 Reference Package org.apache.http.cookie.params</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/params/package-summary.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/params/package-summary.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/params/package-summary.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/cookie/params/package-summary.html Mon Oct  7 17:52:27 2013
@@ -3,7 +3,7 @@
 <html xml:lang="en" lang="en">
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-		<title>Apache HttpClient 4.3 Reference Package org.apache.http.cookie.params</title>
+		<title>Apache HttpClient 4.3.1 Reference Package org.apache.http.cookie.params</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/impl/auth/package-frame.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/impl/auth/package-frame.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/impl/auth/package-frame.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/impl/auth/package-frame.html Mon Oct  7 17:52:27 2013
@@ -3,7 +3,7 @@
 <html xml:lang="en" lang="en">
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-		<title>Apache HttpClient 4.3 Reference Package org.apache.http.impl.auth</title>
+		<title>Apache HttpClient 4.3.1 Reference Package org.apache.http.impl.auth</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>

Modified: httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/impl/auth/package-summary.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/impl/auth/package-summary.html?rev=1530010&r1=1530009&r2=1530010&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/impl/auth/package-summary.html (original)
+++ httpcomponents/site/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/impl/auth/package-summary.html Mon Oct  7 17:52:27 2013
@@ -3,7 +3,7 @@
 <html xml:lang="en" lang="en">
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-		<title>Apache HttpClient 4.3 Reference Package org.apache.http.impl.auth</title>
+		<title>Apache HttpClient 4.3.1 Reference Package org.apache.http.impl.auth</title>
 		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
 	</head>
 	<body>



Mime
View raw message