Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to setup two websites on IIS 6 with two diffent domain names - a.mysite.com and b.mysite.com. And, i want to secure these sites with SSL. So, i got two certificates for each of the domains and installed it on IIS. When i try to access a.mysite.com over SSL, it works. But, accessing b.mysite.com over SSL throws message

b.mysite.com uses an invalid security certificate.

The certificate is only valid for a.mysite.com

(Error code: ssl_error_bad_cert_domain)

Also, i couldn't start b.mysite.com on IIS stating the port is already in use. I see a couple of problems here to solve.

How can i run both the websites on IIS with SSL? What is the cause of certificate error?

Thanks for reading!


Found a similar posting on SO here: http://serverfault.com/questions/58163/iis6-web-site-presenting-the-wrong-ssl-certificate

share|improve this question
I was just about to post the link to the question you just updated with. In essence they're the exact same question: serverfault.com/questions/58163/… –  Mark Henderson Dec 11 '09 at 2:45

1 Answer 1

up vote 6 down vote accepted

The problem is that SSL negotiation is done before the host headers are sent, so you can only have one SSL cert per IP address. This is why you are getting the invalid certificate on b.mysite.com

there are two ways to handle this:

  1. Get a wild card cert for *.mydomain.com
  2. Assign a second IP to the server and run b.mysite.com off this second IP with the proper cert.
share|improve this answer

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.