Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java SSL/TLS with Anonymous Diffie Hellman

Tags:

java

ssl

I have a basic client/server application written in Java which uses plain Sockets for communication.

I'd like to prevent passive eavesdropping attacks against it and do the communication over TLS/SSL. I don't want the application user to get in the hassle of setting up certificates etc., I'd like to setup Sockets over SSL with Anonymous Diffie Hellman using AES encryption (TLS_DH_anon_WITH_AES_128_CBC_SHA mode).

However I can't find any suitable examples on net or any documentation as to how I'd setup the SSLContext or SSLSocketFactory to enable the mode I want. I'd appreciate a minimal example for this.

like image 715
sharjeel Avatar asked Mar 26 '26 20:03

sharjeel


1 Answers

You should set the cipher suite on the SSLSocket (or SSLEngine) using setEnabledCipherSuites.

like image 188
Bruno Avatar answered Mar 28 '26 08:03

Bruno