1

I have stored the server certificates in PKCS#12 keystore. I use certificate inside this for checking the hostname verification. I pass the incorrect hostname to be validated against server certificate, which in case should fail the handshake between client and server. Yet with wrong host name the handshake is successful. P.S. the hostname verification is successful with j2se oe ibm as security vendor. I have specified the comm name of certificate as "localhost". Also the subject alternative name is specified as DNS name = localhost.

final HostNameVerifier hostNameVerifier = new DefaultHostNameVerifier(); clientVerifier.setHostNameVerifier(hostNameVerifier, servercert.getCertificateList()[0], "RSA1024ca3");

setHostNameVerifier just loads the certificate, expected hostname.

afterwards I try to initiate a handshake which should fail as I am specifying the expected "hostname": to be RSA1024ca3, butcertificate has hostname as "localhost"

C.k.
  • 93
  • 2
  • 13

0 Answers0