'OpenSSL - curl, wget not working for local domains

I have a server (Centos 7) behind a NAT and whenever I try to access a local domain configured with Let's Encrypt SSL certificate (basically it can be any not self-signed certificate) I get an error.

[root@server2 ~]# curl https://my.domain
curl: (35) SSL received a record that exceeded the maximum permissible length.
[root@server2 ~]# wget https://my.domain
--2022-03-09 12:48:15--  https://my.domain/
Resolving my.domain (my.domain)... 100.100.100,100
Connecting to my.domain (my.domain)|100.100.100.100|:443... connected.
OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Unable to establish SSL connection.

I can access via curl or wget any other https website that is not hosted on the same server.

Also, from other servers, I can access https://my.domain/ without any issue, so I experience problems only locally.

How can I debug what is wrong with this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source