Android 4.4.2 SSL handshake aborted

Code funktioniert auf meinem Genymotion Android 4.4.4 emulator aber nicht auf dem Gerät, die ich benutze (4.4.2).

Habe ich versucht, viele "trauen Zertifikat" workarounds aber ohne Erfolg (ich glaube nicht, dass dies das Problem ist ohnehin, wie das Zertifikat der AOK).

Ich glaube, ich habe erkannt, dass der verschlüsselte (mit einem wireshark trace von meinem desktop); TLS 0x00 0x1E, die scheint etwas selten ist?

Irgendeine Idee wie man das beheben kann?

Hier ist mein code

StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
CloseableHttpClient client = HttpClientBuilder.create().setSSLSocketFactory(sslsf).build();
String baseURL = "https://mysite.co.uk/api/";
HttpGetHC4 request = new HttpGetHC4(baseURL + "/authenticate?user=abcd&password=1234");
CloseableHttpResponse response = client.execute(request);

And error;

 javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x6abff398: Failure in SSL library, usually a protocol error
 error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x684dfce0:0x00000000)
     at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:449)
     at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:340)
     at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:281)
     at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:124)
     at org.apache.http.impl.conn.BasicHttpClientConnectionManager.connect(BasicHttpClientConnectionManager.java:322)
     at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:373)
     at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:225)
     at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
     at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
     at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
     at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:178)
     at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
     at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
     at com.example.lee.printticket.Main$OrderAsyncTask.onPostExecute(Main.java:239)
     at com.example.lee.printticket.Main$OrderAsyncTask.onPostExecute(Main.java:189)
     at android.os.AsyncTask.finish(AsyncTask.java:632)
     at android.os.AsyncTask.access$600(AsyncTask.java:177)
     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:136)
     at android.app.ActivityThread.main(ActivityThread.java:5017)
     at java.lang.reflect.Method.invokeNative(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:515)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
     at dalvik.system.NativeStart.main(Native Method)
 Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x6abff398: Failure in SSL library, usually a protocol error
 error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x684dfce0:0x00000000)
     at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
     at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:406)
    ... 25 more

BEARBEITEN

Versuchen Sie es mit einer anderen Technik/Bibliothek;

        RequestQueue queue = Volley.newRequestQueue(this);
        String url ="https://mysite.co.uk/api/authenticate?user=abcd&password=1234";

        //Request a string response from the provided URL.
        StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
                new Response.Listener<String>() {
                    @Override
                    public void onResponse(String response) {
                        //Display the first 500 characters of the response string.
                        Log.d("response: ", response);
                    }
                }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                Log.d("response: ", error.toString());
            }
        });
        //Add the request to the RequestQueue.
        queue.add(stringRequest);

Zurück;

D/response:: com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x6ad51be0: Failure in SSL library, usually a protocol error
D/response:: error:140740B5:SSL routines:SSL23_CLIENT_HELLO:no ciphers available (external/openssl/ssl/s23_clnt.c:486 0x684dfce0:0x00000000)

Oder mit dem NoSSLv3SocketFactory hack aus Javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: Failure in SSL library, in der Regel ein Protokoll-Fehler;

        HttpStack stack = new HurlStack(null, new NoSSLv3SocketFactory());
        RequestQueue queue = Volley.newRequestQueue(this, stack);

Zurück;

D/response:: com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x6ae51d30: Failure in SSL library, usually a protocol error
D/response:: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x684dfce0:0x00000000)
  • Ich denke, Sie suchte eine Menge für das problem, aber haben Sie diese gesehen?: stackoverflow.com/questions/29916962/...
  • Ich Tat, aber ich kann nicht scheinen, um Abbildung, wie die NoSSLv3SocketFactory zu CloseableHttpClient. Wenn ich versuche so etwas wie SSLSocketFactory nosslv3 = new NoSSLv3SocketFactory(sslc.getSocketFactory()); CloseableHttpClient client = HttpClientBuilder.create().setSSLSocketFactory(nosslv3).build(); bekomme ich setSSLSocketFactory (org.apache.http.conn.socket.LayeredConnectionSocketFactory in HttpClientBuilder cannot be applied to javax.net.ssl.SSLSocketFactory
  • 0x00,0x1E ist TLS_KRB5_WITH_DES_CBC_SHA und wäre in der Tat sehr selten und auch sehr unsicher. Ich bezweifle, dass dieses Verfahren funktionieren würde, mit Android 4.4.4. Stattdessen würde ich davon ausgehen, Probleme mit Server Name Indication, aber mehr kann erst gesagt werden, wenn man mehr weiß über die Ziel-Website. Check SSLLabs bei Problemen mit bestimmten Android-Versionen, oder wenn die Website erfordert, SNI.
  • Das Stopfen der Website in nicht zurück, was seltsam, dass ich sehen konnte. Scheint die Unterstützung für TLS 1.0, TLS 1.1 und TLS 1.2. Unter handshake-simulation schlägt TLS 1.2 w/ ciper; TLS_RSA_WITH_RC4_128_SHA für android 4.4.2?
  • Ich habe nun bestätigt, das Gerät nicht zulassen, SSLv3. Aber das erklärt immer noch nicht, warum ich nicht bekommen kann es arbeiten, die mithilfe von TLS.
  • Ich bin jetzt zu der Annahme geführt, keine der Chiffren von der Seite unterstützt wird, werden vom Gerät unterstützt. Es wäre toll, einen Weg zu finden, java explizit angeben, diese? In dem moment, als ich umgehen, ich hatte zum erstellen einer http->https apache proxy
  • wenn Sie eine Antwort zu finden, sollten Sie es veröffentlichen. Das ist eine interessante Frage und ich werde es befolgen.
  • Ich habe ähnliche Problem. Die Android-version ist 4.4.4. Der server ist voll http2 mit TLS 1.2.
  • Ich bin immer gleiche problem in Samsung galaxy note 2, OS 4.4.2. Es wäre toll, wenn einer helfen kann ?

InformationsquelleAutor Lee Tickett | 2015-12-28
Schreibe einen Kommentar