koush / ion

Android Asynchronous Networking and Image Loading
Other
6.29k stars 1.03k forks source link

SSLException: encrypted packet oversized #808

Open amosyuen opened 7 years ago

amosyuen commented 7 years ago

Ion Version: 2.1.8 Device: Samsung Galaxy S5 Android Version: 6.0.1

When trying to fetch an image from an HTTPS url like https://s3-ap-southeast-1.amazonaws.com/radius-files/users/58883f0e88b1b1000a2ab5c5.jpg?1485324119111 I get this error:

javax.net.ssl.SSLException: encrypted packet oversized
        at com.google.android.gms.org.conscrypt.OpenSSLEngineImpl.unwrap(:com.google.android.gms:496)
        at com.google.android.gms.org.conscrypt.OpenSSLEngineImpl.unwrap(:com.google.android.gms:458)
        at com.google.android.gms.org.conscrypt.OpenSSLEngineImpl.unwrap(:com.google.android.gms:423)
        at com.koushikdutta.async.AsyncSSLSocketWrapper$5.onDataAvailable(AsyncSSLSocketWrapper.java:194)
        at com.koushikdutta.async.Util.emitAllData(Util.java:23)
        at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:152)
        at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:789)
        at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:627)
        at com.koushikdutta.async.AsyncServer.access$700(AsyncServer.java:41)
        at com.koushikdutta.async.AsyncServer$13.run(AsyncServer.java:569)

The request used to work fine. Not sure what changed. Also if I make a request using a simple HttpUrlConnection it works fine.

amosyuen commented 7 years ago

Looks like it might be related to this change in conscrypt that went in 3 months ago... https://github.com/google/conscrypt/commit/61a535179ea142718ca975dfc3e89df70dabf428

I filed an issue for conscrypt too at https://github.com/google/conscrypt/issues/76

mightyfrog commented 7 years ago

Is there any workaround for this?

koush commented 7 years ago

Can disable conscrypt in ion if this is happening.


Ion.getDefault(context).getConscryptMiddleware().enable(false)