java - Server doesn't support Android 5.0's default cipher suite -


after updating android 5.0 lollipop, httpsurlconnection occurs handshake error.

05-05 14:54:08.821  10855-11793/com.soonoo.mobilecampus e/info﹕ javax.net.ssl.sslhandshakeexception: handshake failed     @ com.android.org.conscrypt.opensslsocketimpl.starthandshake(opensslsocketimpl.java:374)     @ com.android.okhttp.connection.upgradetotls(connection.java:238)     @ com.android.okhttp.connection.connect(connection.java:158)     @ com.android.okhttp.connection.connect(connection.java:170)     @ com.android.okhttp.internal.http.httpengine.connect(httpengine.java:309)     @ com.android.okhttp.internal.http.httpengine.sendrequest(httpengine.java:242)     @ com.android.okhttp.internal.http.httpurlconnectionimpl.execute(httpurlconnectionimpl.java:388)     @ com.android.okhttp.internal.http.httpurlconnectionimpl.connect(httpurlconnectionimpl.java:118)     @ com.android.okhttp.internal.http.httpurlconnectionimpl.getoutputstream(httpurlconnectionimpl.java:220)     @ com.android.okhttp.internal.http.delegatinghttpsurlconnection.getoutputstream(delegatinghttpsurlconnection.java:218)     @ com.android.okhttp.internal.http.httpsurlconnectionimpl.getoutputstream(httpsurlconnectionimpl.java:25)     @ com.soonoo.mobilecampus.user.login(user.java:72)     @ com.soonoo.mobilecampus.loginview$login.doinbackground(loginview.java:112)     @ com.soonoo.mobilecampus.loginview$login.doinbackground(loginview.java:84)     @ android.os.asynctask$2.call(asynctask.java:288)     @ java.util.concurrent.futuretask.run(futuretask.java:237)     @ android.os.asynctask$serialexecutor$1.run(asynctask.java:231)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:587)     @ java.lang.thread.run(thread.java:818)  caused by: javax.net.ssl.sslprotocolexception: ssl handshake aborted: ssl=0xaaaf8a00: failure in ssl library, protocol error error:1407743e:ssl routines:ssl23_get_server_hello:tlsv1 alert inappropriate fallback (external/openssl/ssl/s23_clnt.c:765 0xa9295b25:0x00000000)         @ com.android.org.conscrypt.nativecrypto.ssl_do_handshake(native method)         @ com.android.org.conscrypt.opensslsocketimpl.starthandshake(opensslsocketimpl.java:302)         ... 19 more 

a server want connect using httpsurlconnection supports below cipher suites. problem android 5.0 not support 1 of below cipher suites...

ssl_ck_rc4_128_export40_with_md5 ssl_ck_rc2_128_cbc_export40_with_md5 tls_rsa_export_with_rc4_40_md5 tls_rsa_export_with_rc2_cbc_40_md5 ssl_ck_des_64_cbc_with_md5 ssl_ck_rc4_128_with_md5 ssl_ck_rc2_128_cbc_with_md5 ssl_ck_idea_128_cbc_with_md5 tls_rsa_with_rc4_128_md5 ssl_ck_des_192_ede3_cbc_with_md5 

then isn't there can client side?

you should try specifying following cipher suites:

ciphersuite.tls_ecdhe_ecdsa_with_aes_128_cbc_sha,                     ciphersuite.tls_ecdhe_ecdsa_with_aes_256_cbc_sha,                     ciphersuite.tls_ecdhe_rsa_with_aes_128_cbc_sha,                     ciphersuite.tls_ecdhe_rsa_with_aes_256_cbc_sha,                     ciphersuite.tls_dhe_rsa_with_aes_128_cbc_sha,                     ciphersuite.tls_dhe_rsa_with_aes_256_cbc_sha,                     ciphersuite.tls_dhe_dss_with_aes_128_cbc_sha,                     ciphersuite.tls_dhe_dss_with_aes_256_cbc_sha,                     ciphersuite.tls_ecdhe_ecdsa_with_rc4_128_sha,                     ciphersuite.tls_ecdhe_rsa_with_rc4_128_sha,                     ciphersuite.tls_rsa_with_aes_128_gcm_sha256,                     ciphersuite.tls_rsa_with_aes_256_gcm_sha384,                     ciphersuite.tls_rsa_with_aes_128_cbc_sha,                     ciphersuite.tls_rsa_with_aes_256_cbc_sha 

Comments