While disabling hostname verification significantly reduces security, sometimes you have no other option than to do it.
For example, when you get the following exception:
javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching <FQDN> found.
$ make
This should produce dist/LenientHostnameVerifierAgent.jar
, which is
already included in this repository for convenience.
$ java -javaagent:LenientHostnameVerifierAgent.jar \
-jar YourJarFile.jar
The code in src/LenientHostnameVerifierAgent.java was taken from the following page:
https://stackoverflow.com/questions/6031258/java-ssl-how-to-disable-hostname-verification
Thank you, Vadzim.
This project is licensed under the terms of the MIT license.
Code taken from Stack Overflow is licensed CC BY-SA 4.0.