I want to put a web server on port 3 of my Openwrt router and create another interface and address series to it. Port 0 is WAN and 1 and 2 br-lan. I managed to create the interface, a working DHCP and a new IP series 192.168.22.x under port 3. I can access the server from LAN and LAN is not visible to the server. Fine so far.
Then I installed Caddy, created port forwards 80 and 443, and registered two names to my registrar. The names propagated and Caddy created the certificates fine. Now I can access the server from OUTSIDE and certificates work right.
Unfortunately, if I access the server from LAN, the certificates are wrong. OpenWRT router seems to do some kind of address translation where the address and certificate do not match.
Is there a solution to this certificate problem? I wanted to bridge port 3 and WAN and get a second IP from my provider, but could not figure out how. Maybe that could have solved the issue.
I also checked that from the web server itself, I can wget self and the certificates are right. Also from an external computer. Certificates are wrong only to the local LAN.
I also checked if rebind protection could cause this, but did not notice any change.