Skip to content
Advertisement

Java CertificateException “No subject alternative names matching IP address … found”

I’m trying to implement a selfsigned certificate into my webserver, and it’s working already with firefox and chrome (both from the server itself and from a remote machine)… but I can’t get it to work with java. I’ve already created a keystore file that contains my certificate, but every time I try to connect to the Server it gives me a SSLHandshakeException: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address 192.168.178.71 found

The code I’m using for this test is:

JavaScript

And when checking my certificate with openssl it gives me this:

JavaScript

Can anyone help me solve this problem? I know that I could just go for a hostname, but I would like to have it work this way too

Advertisement

Answer

Your certificate should include that ip value as a subject alternative name value (of type IPAddress : key=7).

http://web.archive.org/web/20160201235032/http://www.jroller.com/hasant/entry/no_subject_alternative_names_matching

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement