Tag Archives: javax.net.ssl.SSLHandshakeException: No appropriate protocol

javax.net.ssl.SSLHandshakeException: No appropriate protocol [How to Solve]

javax.net.ssl.sslhandshakeexception: no approve protocol error resolution
1. Problem descriptionA simple email sending program is developed in Java. The local operation is normal, but an error occurs when it is uploaded to the server

	javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1972)
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:642)
	at javax.mail.Service.connect(Service.java:317)
	at javax.mail.Service.connect(Service.java:176)
	at javax.mail.Service.connect(Service.java:125)
	at javax.mail.Transport.send0(Transport.java:194)
	at javax.mail.Transport.send(Transport.java:124)

2. Problem solving

1. Find the JDK directory/JRE/lib/security/java.security, remove SSLv3, tlsv1 and tlsv1.1 in jdk.tls.disabledalgorithm.

2. You need to execute the following commands to finally solve the error report. Refer to https://stackoverflow.com/questions/38205947/sslhandshakeexception-no-appropriate-protocol#

update-crypto-policies --set LEGACY

Java call ssl exception (javax.net.ssl.SSLHandshakeException: No appropriate protocol)

Today, I used jdk1.8 for the upgrade and found that when Java called SSL, an exception was suddenly thrown.

After a while, I finally found out that there was a problem with the SSL calling authority because of the jdk1.8 version.

Solution: Find the jdk 1.8 installation directory and find a java.security under lib\security in C:\Program Files\Java\jre. Find the corresponding SSLv3, delete it, and restart the project. (Deleting SSLv3 means allowing SSL calls)