LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-30-2009, 05:36 AM   #1
vanderkerkoff
LQ Newbie
 
Registered: Aug 2006
Posts: 4

Rep: Reputation: 0
Multiple secure sites per IP address


Hello there

I've recently had the need to run two sites on the same machine with https.

My first site a.com I registered the certificate, no probs.

The second site, b.com, I registered, then when I ran it it spewed an error hostname mismatch, as expected. I wasn't aware of this limitation at the time but do now :-)

I then asked a colleague who said if I run the second site on a non standard port, say 8443, then the second security certificate will validate.

Can anyone explain how that works to me? Also, is it a good idea?

Thanks in advance
 
Old 09-30-2009, 06:34 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Your colleague is partially right. Until now it was not possible to have to 2 SSL servers running on the same IP and listening on the same port.
This is now possible using the new SNI extension. Read this for details and for an explanation why it was not possible before.

Regards
 
Old 09-30-2009, 06:50 AM   #3
vanderkerkoff
LQ Newbie
 
Registered: Aug 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks Bathory, I'm looking into SNI now, looks good. I'm using nginx though so I'm asking about on their IRC to see if there is an equivalent in nginx.

Out of interest, how does the certificate work if I run the second site on another port?

Thanks again

Quote:
Originally Posted by bathory View Post
Hi,

Your colleague is partially right. Until now it was not possible to have to 2 SSL servers running on the same IP and listening on the same port.
This is now possible using the new SNI extension. Read this for details and for an explanation why it was not possible before.

Regards
 
Old 09-30-2009, 07:03 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
For apache you have to define something like that:
Code:
Listen 443
Listen 8443
<VirtualHost _default_:443>
  ServerName server1.domain.com
  ...
  ...
  SSLEngine On
  SSLCertificateKeyFile /path/to/certificate1.key
  SSLCertificateFile /path/to/certificate1.crt
</VirtualHost>

<VirtualHost _default_:8443>
  ServerName server2.domain.com
  ...
  ...
  SSLEngine On
  SSLCertificateKeyFile /path/to/certificate2.key
  SSLCertificateFile /path/to/certificate2.crt
</VirtualHost>
 
Old 09-30-2009, 07:06 AM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by vanderkerkoff View Post
Out of interest, how does the certificate work if I run the second site on another port?
The answer is a bit hidden in the text bathory linked to

Code:
The ordinary behavior, then, is that the SSL connection is set up using the configuration in the default virtual host for the address where the connection was received.
As the webserver uses its default vhost it will always use the same certificate despite the configured certificate for the vhost.
If you use a different port you have a different default configuration so the right certificate is used.
 
Old 09-30-2009, 07:15 AM   #6
vanderkerkoff
LQ Newbie
 
Registered: Aug 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks everyone

I can see how it is working on port 8443 now, and also that SNI would be a much better solution.

On this video on how to get it working on nginx, http://www.ehow.com/video_5204262_co...ation-sni.html

Art mentions that this will not work on any browser running on an XP box as it's not in the XP network stack. Does this mean that whatever web server I choose, apache or nginx, when I'm using SNI any browser on an XP box will not handle it properly?

Thanks again
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems Browsing Secure Sites (HTTPS) jlrq74 Linux - Wireless Networking 2 09-30-2008 09:05 AM
Client cannot open few https://.. sites i.e. secure sites rajeshghy Linux - General 1 11-02-2006 06:30 AM
Bind configuration for multiple sub-domains on multiple sites JF1980 Linux - Networking 3 08-31-2006 01:28 PM
Multiple Apache Sites, on Multiple IP's, on Same Box?? RickyJ Linux - General 1 06-19-2003 10:55 AM
Multiple Apache Sites, on Multiple IP's, on Same Box?? RickyJ Linux - Software 0 06-19-2003 09:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration