IP address as hostname (CN) when creating a certificate? (HTTPS hostname wrong: should be <ipAddress>) [duplicate]
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: How are SSL certificate server names resolved/Can I add alternative names using keytool? I created a certificate and set the CN to the IP address of my server which is in xxx.xxx.xxx.xxx format. But when I try to run my code in Java, I'm getting a HTTPS hostname wrong: should be <xxx.xxx.xxx.xx> error message. What could be wrong? I'm sure that I'm connecting to the correct IP address. However, I did not