I'm trying to get an image via an https URL, and am having some problems. I generate a keystore with Java's keytool command. If I specify the common name (CN) equal to my hostname, such as CN=JONMORRA, and then try to query via my hostname, such as https://JONMORRA:8443/ then it works fine. However, if I specify the common name as my ip address, such that CN=192.168.56.1, and try to query via my ip address, such as https://192.168.56.1:8443/ then I get an error
HTTPS hostname wrong: should be <192.168.56.1>
Which is stating that my hostname is wrong, even though that's what I specified in the keystore.
I would like to use ip addresses instead of hostnames so I can query between Linux and Windows boxes without worrying about hostnames.
Why is the CN not accepting ip addresses, and how can I fix it?
Thanks
To acutally generate a valid certificate using keytool
, use:
keytool -keystore keystore.jks -genkey -ext SAN=IP:{IP_ADDRESS}
e.g.:
keytool -keystore keystore.jks -genkey -ext SAN=IP:192.168.1.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With