# Multiple SSL

**URL:** <https://www.ruby-forum.com/t/multiple-ssl/138887>\
**Category:** NGINX\
**Created:** [May 28, 2008, 5:20pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887 "2008-05-28T17:20:41Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 28, 2008, 5:20pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/1 "2008-05-28T17:20:41Z")

</div>

I just added a second SSL site to Nginx uising two different certs. The  
problem is that both sites are pulling the one cert. I have each of  
them served on 443 and serving their own domains. Just like i would  
think port 80 to work with multiple sites but its not. Is there another  
port i should use for the second instance say 444 ? and just action that  
in rails ? anyone experience similar ?

Chris

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 28, 2008, 6:33pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/2 "2008-05-28T18:33:50Z")

</div>

On Wed, May 28, 2008 at 11:07 AM, Eire A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I just added a second SSL site to Nginx uising two different certs. The  
> problem is that both sites are pulling the one cert. I have each of them  
> served on 443 and serving their own domains. Just like i would think port  
> 80 to work with multiple sites but its not. Is there another port i should  
> use for the second instance say 444 ? and just action that in rails ?  
> anyone experience similar ?

I think I experienced this at first, and IIRC it was a wildcard name  
on one of the domains causing it… removed that and it works now

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 28, 2008, 6:53pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/3 "2008-05-28T18:53:52Z")

</div>

We bind extra SSL sites to 444,445,etc to avoid these issues. We run  
an lvs load balancer in front of them and assign a public IP per SSL  
server instance. So external ip #1 443 routes to internal 443 and  
external ip #2 443 routes to internal 444. It greatly simplified  
things for us but it might not be an option for everyone.

\_\_  
Corey D.  
removed\_email\_address@domain.invalid  
(866) 518-9273 x207

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 28, 2008, 6:44pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/4 "2008-05-28T18:44:27Z")

</div>

Chris,

Are you using one ip address for multiple domain/ssl certs? If so, I  
believe you may need to assign each cert to a separate ip.

Are you using a separate host names in one domain? You might need a  
wild card certificate (\*.yourdomain.com). There is a problem in that  
nginx needs to see the request URL before deciding which cert to use  
in the handshake. However, nginx cannot see the URL until the  
handshake has been completed. See  
[NameBasedSSLVHosts - HTTPD - Apache Software Foundation](http://wiki.apache.org/httpd/NameBasedSSLVHosts) for more details.

If you get it working or you have a different setup then send mail to  
the list.

–  
Calomel @ [https://calomel.org](https://calomel.org)  
Open Source Research and Reference

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 29, 2008, 1:22am UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/5 "2008-05-29T01:22:57Z")

</div>

you cant do virtual naming with ssl

because the cert negotation comes first.

i.e. each ssl site needs its own ip.

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 29, 2008, 4:29am UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/6 "2008-05-29T04:29:38Z")

</div>

Yes I am using one IP with multiple domains/certs  
so depending on the server and if i can get another IP  
I’m pretty certain Virtual servers can get more IP’s w/o  
adding hardware?

“nginx cannot see the URL until the  
handshake has been completed”

makes sense for customer security

Calomel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote: Chris,

Are you using one ip address for multiple domain/ssl certs? If so, I  
believe you may need to assign each cert to a separate ip.

Are you using a separate host names in one domain? You might need a  
wild card certificate (\*.yourdomain.com). There is a problem in that  
nginx needs to see the request URL before deciding which cert to use  
in the handshake. However, nginx cannot see the URL until the  
handshake has been completed. See  
[NameBasedSSLVHosts - HTTPD - Apache Software Foundation](http://wiki.apache.org/httpd/NameBasedSSLVHosts) for more details.

If you get it working or you have a different setup then send mail to  
the list.

–  
Calomel @ [https://calomel.org](https://calomel.org)  
Open Source Research and Reference

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 29, 2008, 6:27pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/7 "2008-05-29T18:27:00Z")

</div>

right. thanks to all the help

Chris

Calomel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote: Chris,

Getting multiple ips for one physically system to multiple virtual  
domains should not be a problem. Once you have the ips then have each  
Nginx server {…} section listen to a separate ip and define its own  
SSL cert.

–  
Calomel @ [https://calomel.org](https://calomel.org)  
Open Source Research and Reference

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 29, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/8 "2008-05-29T17:10:42Z")

</div>

Chris,

Getting multiple ips for one physically system to multiple virtual  
domains should not be a problem. Once you have the ips then have each  
Nginx server {…} section listen to a separate ip and define its own  
SSL cert.

–  
Calomel @ [https://calomel.org](https://calomel.org)  
Open Source Research and Reference

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 29, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/9 "2008-05-29T19:31:15Z")

</div>

Sean A. wrote:

> you cant do virtual naming with ssl
> 
> because the cert negotation comes first.

However, SNI is rapidly becoming an option?

It appears that SNI support has been backported to at least OpenSSL  
0.9.8g ? You need to specify --enable-tlsext when building openssl

What else is required on the nginx side in order to test TLS upgrades?  
Does someone have a sample config showing this working on some web  
browser?

Cheers

Ed W

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 29, 2008, 9:40pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/10 "2008-05-29T21:40:23Z")

</div>

Ed,

As I understand it tlsext is still in “BETA” like stage for 0.9.8g. I  
also believe remote clients must be strictly RFC 4366 compliant  
otherwise browsers will still get a SSL error page.

According to Goggle, this site has a test case tlsext setup.  
[https://dave.sni.velox.ch/](https://dave.sni.velox.ch/)

–  
Calomel @ [https://calomel.org](https://calomel.org)  
Open Source Research and Reference

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 30, 2008, 1:49am UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/11 "2008-05-30T01:49:28Z")

</div>

Calomel wrote:

> Ed,
> 
> As I understand it tlsext is still in “BETA” like stage for 0.9.8g. I  
> also believe remote clients must be strictly RFC 4366 compliant  
> otherwise browsers will still get a SSL error page.
> 
> According to Goggle, this site has a test case tlsext setup.  
> [https://dave.sni.velox.ch/](https://dave.sni.velox.ch/)

Got any tips to configure nginx to support the same (subject to browser  
compatibility, etc)

Cheers

Ed W

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [May 30, 2008, 12:48pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/12 "2008-05-30T12:48:43Z")

</div>

On 5/28/08, Sean A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> you cant do virtual naming with ssl
> 
> because the cert negotation comes first.
> 
> i.e. each ssl site needs its own ip.

Unless you have a wildcard cert, and all the sites are subdomains that  
match the cert.  
😉

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [June 5, 2008, 5:22pm UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/13 "2008-06-05T17:22:39Z")

</div>

yeah, i have… o… 40 or so of those setup right now.

now if you could use a variable name in the cert configurations…  
that and log files, o life would be so much easier.

---

<div class="post-metadata">

**Author:** ![Eire\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/91b2a8/32.png) [@Eire\_A](https://www.ruby-forum.com/u/Eire_A)\
**Post date:** [June 5, 2008, 12:44am UTC](https://www.ruby-forum.com/t/multiple-ssl/138887/14 "2008-06-05T00:44:49Z")

</div>

On May 30, 2008, at 12:41 AM, eliott wrote:

> On 5/28/08, Sean A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > you cant do virtual naming with ssl
> > 
> > because the cert negotation comes first.
> > 
> > i.e. each ssl site needs its own ip.
> 
> Unless you have a wildcard cert, and all the sites are subdomains that  
> match the cert.  
> 😉

ok, you got me on that edge case.
