question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OkHttpClient.setSslSocketFactory missing from OkHttp v3?

See original GitHub issue

Hello,

Apologies in advance if I have missed it, but the method OkHttpClient.setSslSocketFactory appears to be missing from v3 of the API.

I am using this call to enable TLS on Android < 5:

OkHttpClient client = new OkHttpClient(); client.setSslSocketFactory(new TLSSocketFactory());

Where TLSSocketFactory is described here: http://blog.dev-area.net/2015/08/13/android-4-1-enable-tls-1-1-and-tls-1-2/

Is there an alternative way of doing this in v3?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
swankjessecommented, Jan 5, 2016

Try the builder:

OkHttpClient client = new OkHttpClient.Builder()
    .sslSocketFactory(new TLSSocketFactory())
    .build();
Read more comments on GitHub >

github_iconTop Results From Across the Web

OKHttp - Can't find setSslSocketFactory - Stack Overflow
The SslSocketFactory is now configured on the OkHttpClient.Builder client = new OkHttpClient.Builder() .sslSocketFactory(sslSocketFactory ...
Read more >
OkHttpClient.Builder (OkHttp 3.11.0 API) - javadoc.io
Sets the socket factory used to secure HTTPS connections. If unset, the system default will be used. sslSocketFactory. public OkHttpClient.Builder ...
Read more >
HTTPS - OkHttp - Square Open Source
When negotiating a connection to an HTTPS server, OkHttp needs to know which TLS versions and cipher suites to offer. A client that...
Read more >
Trusting a Self-Signed Certificate in OkHttp - Baeldung
Learn how to configure an OkHttpClient to trust self-signed certificates.
Read more >
Maximizing OkHttp connection reuse | by Diego Gómez Olvera
Debugging a 3rd party library ... In Booking.com we use OkHttp, an HTTP client library for Java/JVM clients ... sslSocketFactory, that.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found