Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datafile download fails on API 16 #366

Closed
nathan-l opened this issue Mar 2, 2021 · 4 comments
Closed

Datafile download fails on API 16 #366

nathan-l opened this issue Mar 2, 2021 · 4 comments

Comments

@nathan-l
Copy link

nathan-l commented Mar 2, 2021

Hi.
When downloading a file with the default DataFileClient, urlConnection.connect(); fails with an ssl error, here is the full stacktrace.

error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x671c3d74:0x00000000)
	at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:448)
	at com.android.okhttp.Connection.upgradeToTls(Connection.java:146)
	at com.android.okhttp.Connection.connect(Connection.java:107)
	at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
	at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
	at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
	at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
	at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:89)
	at com.android.okhttp.internal.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:161)
	at com.optimizely.ab.android.datafile_handler.DatafileClient$1.execute(DatafileClient.java:84)
	at com.optimizely.ab.android.datafile_handler.DatafileClient$1.execute(DatafileClient.java:68)
	at com.optimizely.ab.android.shared.Client.execute(Client.java:143)
	at com.optimizely.ab.android.datafile_handler.DatafileClient.request(DatafileClient.java:113)
	at com.optimizely.ab.android.datafile_handler.DatafileLoader$1.run(DatafileLoader.java:100)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
	at java.lang.Thread.run(Thread.java:841)
Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x68a5f008: 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:741 0x671c3d74:0x00000000)
	at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
	at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:405)

I think this is happening because android <20 don't support TLS1.2+ by default.

@jaeopt
Copy link
Contributor

jaeopt commented Mar 2, 2021

@nathan-l Thanks for sharing. We'll take a look at it.

@thomaszurkan-optimizely
Copy link
Contributor

@nathan-l , if you are using google play there is an easy solution using provider installer [here].(https://guides.codepath.com/android/Using-OkHttp#enabling-tls-v1-2-on-older-devices)

@nathan-l
Copy link
Author

nathan-l commented Mar 2, 2021

Thanks @jaeopt. @thomaszurkan-optimizely, unfortunately a signifant part of our clients are not running google play so we can' t rely on the gms provider to solve this.

We are using a custom SSLSocketFactory that we set in our OkHttp instance to support TLS1.2 on our API; but this solution isn't applicable to the SDK http client.

@jaeopt
Copy link
Contributor

jaeopt commented Jun 3, 2021

@nathan-l SDK 3.10.2 has been released with the TSL support for API-16+

@jaeopt jaeopt closed this as completed Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants