Java http clients and POODLE

后端 未结 4 1757
闹比i
闹比i 2020-12-05 11:31

Regarding the POODLE vulnerability, if I understand it correctly, it requires a client that automatically downgrades TLS protocol to SSLv3 when failing to establish a secure

4条回答
  •  清歌不尽
    2020-12-05 12:03

    Apache HttpClient does not implement any of the TLS protocol aspects. It relies on JSSE APIs to do TLS/SSL handshaking and to establish secure SSL sessions. With the exception of SSL hostname verification logic, as far as TLS/SSL is concerned Apache HttpClient is as secure (or as vulnerable) as the JRE it is running in.


    Update: HttpClient 4.3 by default always uses TLS, so, unless one explicitly configures it to use SSLv3 HttpClient should not be vulnerable to exploits based on POODLE.

    This turned out to be wrong. One MUST explicitly remove SSLv3 from the list of supported protocols!

    SSLContext sslContext = SSLContexts.custom()
            .useTLS() // Only this turned out to be not enough
            .build();
    SSLConnectionSocketFactory sf = new SSLConnectionSocketFactory(
            sslContext,
            new String[] {"TLSv1", "TLSv1.1", "TLSv1.2"},
            null,
            SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
    CloseableHttpClient client = HttpClients.custom()
            .setSSLSocketFactory(sf)
            .build();
    

    Update 2: As of version 4.3.6 HttpClient disables all versions of SSL (including SSLv3) by default.

提交回复
热议问题