I think the issue is our Webmin/virtualmin is not providing SNI correctly. I’m sure its an easy fix ?
here is the Apcahe Error Log entry:
[ssl:error] [pid 843455:tid 123…] [client aa.bb.cc.dd:60576] AH02032: Hostname domain1.com (default host as no SNI was provided) and hostname domain2.com provided via HTTP have no compatible SSL setup
we have a shared fixed ip aa.bb.cc.dd
we have external DNS at registra, and have A records for each virtualmin domain, but all use the same IP
The client embedds the cert as the ca.pem for the virtualmin domain (domain2.com)
but the server default is domain1.com
how can we fix this “default host as no SNI was provided” ?
…
I fixed this my side, on the client. for those who stumble on this in the future, within the TLS, set :
.skip_cert_common_name_check = false, //set the Server Name Indication (SNI)
OK, so the SNI is the fix for and MAIN domain, but does NOT fix a subdomain
the subdomain still has:
E (50931) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x2700
I (50931) esp-tls-mbedtls: Failed to verify peer certificate!
we are using a LE cert:
Common Name (CN) = mqtt.domain.com
Issued by:
|Common Name (CN)|R13|
|Organization (O)|Let’s Encrypt|
I can’t keep up with what you’re trying to do. I thought you were trying to use certs signed with your own CA, rather than Let’s Encrypt, so you can have it not expire for many years?
We know SNI works fine in the default Apache or nginx configuration Virtualmin produces, including for sub-servers (whether a subdomain name or not) with Let’s Encrypt certs and any modern browser. So, first confirm it’s working in modern browsers with whatever your current server configuration is, so you can narrow the problem down to an issue with your HTTPS client (which I’m pretty sure this continues to be).
You really need to narrow down what problem you’re trying to solve. Stop changing variables. I can’t keep up, and you will never understand the problem if everything is different in every experiment.
ok, so the good news, all work ok (domain or subdomain, LE or self-signed certs).
the issue was on a server with multiple domains (i.e Webmin running multiple Virtualmin) and only 1 IP address, that SNI / CN has to be enforced, hence in a client with mbedtls, you have to set “.common_name” to be the same as the domain you are trying to reach over HTTPS, i.e