hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruce Adams (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1784) TLS Client Hello is always TLS 1.0 (0x0301) under IBM Java
Date Wed, 12 Oct 2016 00:29:20 GMT
Bruce Adams created HTTPCLIENT-1784:
---------------------------------------

             Summary: TLS Client Hello is always TLS 1.0 (0x0301) under IBM Java
                 Key: HTTPCLIENT-1784
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1784
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient (classic)
    Affects Versions: 4.5.2
         Environment: IBM Java, many versions including latest Java 8.
            Reporter: Bruce Adams


A simple client program fails to connect to any site that _requires_ TLSv1.2. The Java program
below, given the URL https://www.sandbox.paypal.com fails with:

bq. javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

when run on the latest released IBM Java, {{pxa6480sr3fp12-20160919_01(SR3 FP12)}} (available
in a Docker image {{ibmcom/ibmjava:8-sdk}}). The same run is successful on a recent Oracle
Java 8.

I similar, simple, Java program that uses the built-in Java libraries instead of Apache HttpClient
works fine on both IBM Java and Oracle Java.

{{ApacheGet.java}}

// Sorry. I didn't figure out how to properly format code in here.
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

class ApacheGet {
  public static void main(String args[]) throws Exception {
    String urlString = args[0];
    HttpGet httpGet = new HttpGet(urlString);
    CloseableHttpClient httpClient = HttpClients.createDefault();
    try {
      CloseableHttpResponse response = httpClient.execute(httpGet);
      try {
        System.out.println(response.getStatusLine());
      } finally {
        response.close();
      }
    } finally {
      httpClient.close();
    }
  }
}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message