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.

HTTPS - Breaking client authentication on server side

See original GitHub issue

Hi Guys,

When you don’t specify a sslSocketFactory okhttp recreate a TLS SSLcontext instead of using SSLContext.getDefault. Doing so you init the SSLContext without giving the default keyStore and this break server side client certificate authentication.

In a system where you configure your trustCertificate and keyStore using system properties like “javax.net.ssl.keyStore” & “javax.net.ssl.trustStore” , java merge them and init the SSLContext.getDefault for you. Basically you just need to get the socketFactory from that default context.

To make sure the sslsocket factory contain my client certificate from the keystore I have to call OkHttpClient.builder.slSocketFactory(**SSLContext.getDefault().getSocketFactory**, trustManager)

Let me know if you guys need something or if i got it wrong I will try to follow with a pull request.

Best,

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yschimkecommented, Mar 29, 2020

Won’t fix.

0reactions
yschimkecommented, Feb 8, 2022

Let me know how you go, if you are still stuck I can take a look at the weekend.

I will try to make a clean sample of the CapturingTrustManager and make it smart enough to log the issue, as I think it might simplify a lot of these types of investigations.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client Side certificate authentication failure - ssl - Server Fault
On the server side, my logs reflect that there's an unknown ca or certificate unkown whenever I try to accept bytes from my...
Read more >
KB5014754—Certificate-based authentication changes on ...
When a server application requires client authentication, Schannel automatically attempts to map the certificate that the TLS client supplies to a user account....
Read more >
why a client authentication is not commonly performed in the ...
In no way can a SSL/TLS client authentication be a proof which could be used to resolve some legal conflict between the user...
Read more >
How SSL and TLS provide authentication - IBM
How SSL and TLS provide identification, authentication, confidentiality, and integrity. During both client and server authentication there is a step that ...
Read more >
How to Set Up SSL Client Authentication | JSCAPE
Learn how to set up SSL client authentication for HTTPS and FTPS servers online! This guide offers a quick tutorial for enabling client...
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