Zend certified PHP/Magento developer

SSL certificate mismatch within home network

I use Home Automation to control my heating, lights etc.

I installed a letsencrypt cert and I use a custom domain name to access it securely.

https://home.mydomain.tld/

This uses port 443 natively.

More recently I used letsencrypt to install another cert on my Ubiquity ER-X router so that I can also access it securely.

(It also uses port 443 natively, so I set up a port forward from 7575 to 443.)

https://router.mydomain.tld:7575/

Everything works perfectly from all devices within my network — and from outside of my network — with one exception.

I’ve directed the Home Assistant app to home.mydomain.tld. When used externally, fine. But when when used from within my network it instead picks up the cert for router.mydomain.tld.

TrafficStats: tagSocket(236) with statsTag=0xffffffff, statsUid=-1
chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -200
WebviewActivity: onReceivedSslError: primary error: 2 certificate: Issued to: CN=router.mydomain.tld;
WebviewActivity: Issued by: CN=R3,O=Let's Encrypt,C=US;
WebviewActivity:  on URL: https://home.mydomain.tld/?external_auth=1

I have no clue how to segregate the two. Any ideas?

(I have a feeling the answer will be to set up a reverse-proxy. I’m open to that idea, but hoping there is a simpler solution.)