SSL works in http://ip/ ,but no in https://ip/

Keywords: WordPress - AWS - Technical issue - Secure Connections (SSL/HTTPS)

bndiagnostic ID: 80dd8aa6-454a-f0ab-776c-d41be30738ea

bndiagnostic output:

? Resources: Found possible issues

bndiagnostic failure reason: The suggested guides are not related with my issue

Description:
Hi,
I Run the sudo /opt/bitnami/bncert-tool . it succesfully installed the certs in my domain. But when I curl https

$curl -LI "https://IP_AD"
curl: (60) SSL: no alternative certificate subject name matches target host name 'IP_AD'
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it.

However, the curl in http to my IP works

$curl -LI "http://IP_AD"
HTTP/1.1 301 Moved Permanently
Date: Sat, 11 Jun 2022 23:57:35 GMT
Server: Apache/2.4.51 (Unix) OpenSSL/1.1.1n
X-Powered-By: PHP/7.4.24
X-Pingback: http://imprentacalero.com/xmlrpc.php
X-Redirect-By: WordPress
Location: https://imprentacalero.com/
Content-Type: text/html; charset=UTF-8

HTTP/1.1 200 OK
Date: Sat, 11 Jun 2022 23:57:36 GMT
Server: Apache/2.4.51 (Unix) OpenSSL/1.1.1n
X-Powered-By: PHP/7.4.24
X-Pingback: https://imprentacalero.com/xmlrpc.php
Link: <https://imprentacalero.com/wp-json/>; rel="https://api.w.org/", <https://imprentacalero.com/wp-json/wp/v2/pages/1256>; rel="alternate"; type="application/json", <https://imprentacalero.com/>; rel=shortlink
Content-Type: text/html; charset=UTF-8

So Did i miss a step to add the cert to the https ip?

Hi @yoncho,

SSL works with an associated domain name. When you access the website through HTTPS using the IP the certificate domain does not coincide. It will work with the domain name:

curl -LI https://your.domain.com

Regards,
Michiel

Thank you for your reply Michiel.
Just to be clear, when “curling -LI” https://my_ip/ there will be no SSL associated? Is there a way to get a 302 redirect when curling -LI the https IP to the domain?

Also I have another question, but I dont know if I should continue here or open another Post. I did the WP_REDIRECT change the ip to my domain name. So whenever someone http://my_server_ip/ they automatically redirect to https://my_domain/. But when I write down http://my_ip/products/ , it doesn’t redirect to https://my_domain/products . Why ?

Hi @yoncho,

A certificate can only be attached to a domain.

Is there a way to get a 302 redirect when curling -LI the https IP to the domain?

I don’t think that’s possible.

You need to configure the WordPress domain:

ps/wordpress/administration/configure-domain/

Regards,
Michiel