I am new to ssl and openssl. I am trying to generate a curl request using a .cer file (without using the -k or -insecure flags). After generating the .pem file, I tried to issue the POST request the following way: curl --cacert certificate.pem -XPOST "https://server_ip:server_port?obj1=okay"
When I use my server IP address, I get the error message: curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate.
If I use localhost.localdomain instead of the server_ip, the request is generated correctly.
I understand that ssl certificate can only certify one hostname. Is there a way to change the hostname to the server's ip address instead of localhost.localdomain?
Thank you