SSLSocketFactory.connectSocket(...) possible NPE
------------------------------------------------

                 Key: HTTPCLIENT-932
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-932
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
            Reporter: Sebb


    public Socket connectSocket(
            final Socket sock,
            final InetSocketAddress remoteAddress,
            final InetSocketAddress localAddress,
            final HttpParams params) throws IOException, UnknownHostException, 
ConnectTimeoutException {
...

        SSLSocket sslsock = (SSLSocket) (sock != null ? sock : createSocket()); 
// ==> sock may be null
        if (localAddress != null) {
            sock.setReuseAddress(HttpConnectionParams.getSoReuseaddr(params)); 
// ==> NPE if sock is null
            sslsock.bind(localAddress);
        }

Should sock.setReuseAddress be sslsock.setReuseAddress?


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to