We use a linux based host to host several webshops. All use HTTP to deliver the shops. Now, one customer asked to get a certificate. I have the certificate at hand. I created a second IP address for the first ethernet device. I have created a second section in the Apache configuration that listens on the new IP address on port 443. And then it hit me.
How the heck does the browser know where to go to fetch the website via HTTPS?
There’s only one A record in the DNS entry, which points to IP address A. But the webserver listens (and needs to listen) on IP address B on port 443 for connections to this shop.
How and where is the split between IP A:80 and IP B:443 configured, so that the host can know that he needs to talk to IP B when using HTTPS? Or is this some mechanism that is transparent for the host, like IP forwarding?
It isn’t. You have to use the same IP for both ports.