Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a website, say with an IP address I have an SSL certificate for and when I visit all is good. However if I visit it says the certificate is invalid, which is fair enough. Is there any way to get to redirect to using apache2 or am I stuck with it having a certificate error?

share|improve this question
The warning is correct. Yes you can redirect your site. And yes it is also possible with Apache. – mailq Nov 8 '11 at 21:02
How many people are likely to be visiting you by IP? – ceejayoz Nov 8 '11 at 21:23
None that I know of, I was just trying to cover all bases. – DanielGibbs Nov 9 '11 at 20:46
up vote 3 down vote accepted

No you can't redirect https without first getting the "Invalid Certificate" error if the certificate doesn't match to domain name used (in this case it's the IP since it is manually entered).

You can redirect without this problem because there is no SSL handshake. But if you specify https this requires the use of SSL which in turn returns the "Invalid Certificate" error as there is no way to validate the SSL handshake.

share|improve this answer
The certificate does exist for the domain, just not for the IP address. So if someone visits I am stuck with them seeing the invalid certificate error? – DanielGibbs Nov 8 '11 at 21:11
Yes, pretty much. – Driftpeasant Nov 8 '11 at 21:15
Correct: the SSL handshake -- where the certificate verification happens -- takes place before anything else. So you can't redirect away without that warning, since the handshake happens before HTTP starts. – cjc Nov 8 '11 at 21:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.