I can't get TLS to work

I’ve been trying to follow the tutorial here, after failing to apply it to my project I tried to do the tutorial as it is, and I’m still getting handshaking failures.

On the server side, I have the following exception: javax.net.ssl.SSLHandshakeException: No available authentication scheme

While on the client side, I have the following: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

I’d like to add that I’m starting fresh without any previous any keystore nor truststore, executing the commands in the tutorial does generate the key and trust stores.

I’ve tried making the CN the same as my machine hostname too, didn’t work, nothing worked, the server and the client could never handshake.

Side note: this is just a demo I’m doing, so I don’t really care if it has security flaws, I’m just trying to get TLS to work.

Thx in advance.

Update: I downgraded from JDK21 to JDK17 and it worked fine :/

rorsche,

Is the client presenting a client certificate? handshake_failure with mTLS generally means the client isn’t presenting a certificate when the server requires it

Red1C3,

Yes I guess, downgrading my JDK really did make it work, probably something in the docs has the answer to why something has stopped working

DeepThought42,

Try adding “-Djavax.net.debug=all” to your client command line. The output should point you to what exactly is the matter. Most likely something isn’t right with the certs and/or keystore.

walter_wiggles,

Are you using the server and client from the tutorial?

Red1C3,

Yes.

walter_wiggles,

I copied the commands and ran the server and client from the tutorial and it worked. I’m using java 17, what version are you running?

Red1C3, (edited )

I’m running on 21, I’ll install 17 and try again

Update: it works fine on 17, not sure why it fails on 21

  • All
  • Subscribed
  • Moderated
  • Favorites
  • java@lemmy.world
  • kavyap
  • thenastyranch
  • cubers
  • ethstaker
  • InstantRegret
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • everett
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • GTA5RPClips
  • JUstTest
  • khanakhh
  • normalnudes
  • osvaldo12
  • cisconetworking
  • provamag3
  • Durango
  • tacticalgear
  • modclub
  • Leos
  • megavids
  • tester
  • anitta
  • lostlight
  • All magazines