... I've determined that the HTTP request sent before the SSL connection dictates to the browser which IP address the domain is registered against.
This is wrong. A HTTP request does not determine any relation between a URL/hostname and an IP address. This is done by DNS. But if the redirect is done to the same hostname then the same IP address will usually be used. But it might be a different IP address if multiple IP addresses are associated with the same hostname in DNS.
As a result, any forced redirects will subsequently use the original certificate.
If you are redirecting from HTTP to HTTPS then there is no original certificate, since HTTP has no certificate, only HTTPS. If you redirect from HTTPS on host A to HTTPS on host B then the first access (to host A) must result in the certificate for host A and the second request (to host B) must result in the certificate for host B.
I have an Apache2 server and was forcing a 301 redirect from my old https domain to a new https domain. This caused problems no matter what settings I tried.
In this case you redirect from one hostname to another hostname. The target IP address might be different but it might also be the same if both names are hosted on the same system. But this actually does not matter.
All what matters is that the hostname in the URL must match the subject(s) of the certificate. And the redirect changes the URL and thus might change the hostname of the URL. It does not matter if there are different IP involved or not: if the hostname in the URL does not match the subject of the certificate the validation will fail.
Thus what you need is either:
- Have a certificate which includes both hostnames, i.e. the one you redirect from and the one you redirect too. Use this certificate for both hostnames.
- Or have different certificates for each hostname and set it up, so that the certificate matches the hostname of the server. If both hostnames are served on the same IP address then the clients would need to support SNI which all current browsers do but not all bots or other tools/libraries.