67

I can find various information about SNI (see Wikipedia), but I can't find any statistics about actual support in browsers.

The best I could find out is that it should work on Windows XP with SP3.

Does anyone know if SNI can actually be used in practice?

William
  • 427
  • 1
  • 9
  • 22
Aljosa Mohorovic
  • 771
  • 1
  • 5
  • 4
  • 5
    http://caniuse.com/sni – Nick T Mar 25 '16 at 19:02
  • 1
    Thanks Nick, I just wanted a quick answer and wasn't interested in reading an essay. Sometimes a short answer is the best answer. TL;DR not supported on IE8 on windows XP (< 0.7% of global traffic) - good enough for me! – Scott Jungwirth Apr 14 '16 at 17:58

8 Answers8

92

I can share my experience and approach to switching from one-IP-per certificate in a virtual hosting environment (multiple domains per server) to a load balanced environment with one IP for all domains.

We looked at our Analytics (over 1 million unique visitors / month), which is mostly North American male users looking to buy auto parts online, and found on March 8th, 2014 that approximately 4 % of users were on Windows XP using Internet Explorer (others were minor -- worst case 4.5 % of total users would be affected by not supporting SNI). Keep in mind that we have no "control" over these users so we can't tell them to switch browsers. This percentage is also dropping fairly quickly, at least in the US.

We first decided that it was "OK" for non SNI customers to have a somewhat different experience than customers supporting SNI.

Our approach was to detect server-side (using UA string) which browser/operating system combination does not support SNI (as other people mentioned: Wikipedia article on SNI support). All our domains (~ 120) would have an A record pointing to a single load-balanced IP. We had a second IP (also load balanced) for a domain we can call generic-autoparts.com.

So the setup is [I'm not associated with any domains I use as examples below]:

mikesautoparts.com --> A Nameserver Record of IP X
dansautoparts.com --> A Nameserver Record of IP X
jensautoparts.com --> A Nameserver Record of IP X
... etc

generic-autoparts.com --> A Nameserver Record of IP Y

If a customer hits http://www.dansautoparts.com, and supports SNI, nothing happens. He browses dansautoparts.com, and when it comes time to check out, he uses https://www.dansautoparts.com.

If a customer hits http://www.dansautoparts.com, and we detect that he does not support SNI, we immediately redirect the customer to http://generic-autoparts.com/dansautoparts.com. He shops on there, and at checkout he uses https://generic-autoparts.com/dansautoparts.com

Now, if a customer hits https://www.dansautoparts.com DIRECTLY (link in e-mail, indexed page in search engines), you are out of luck. They'll get a nasty certificate error. In our case, we made sure all e-mails our system sent didn't use https, and we knew that search engines had not indexed our https pages.

Each environment has different challenges and potential trade-offs. We found that this worked well in our case and customers would "accept" (or not notice) getting redirected to http://generic-autoparts.com/[ORIGINAL DOMAIN].com . We also kept checkout secure through generic-autoparts.com.

Let's say 20 % of nonSNI users notice the redirect, it seems fishy, and they leave. In our case, that's 0.8 - 0.9 % (based on March 8th, 2014 numbers) of users and we were willing to "live" with that. I don't have specific data on this right now, but overall sales held steady. [EDIT 3/28/2014: We saw no impact to sales after we switched 100 % of our customers]

Implementation Update July 8th, 2014

Turns out that it's impossible to detect every UA Agent string statically on the server. We implemented the following JavaScript to detect the browser's SNI capability. The general approach is to do a JSONP request against a domain that requires SNI (Apache supports this through "SSLStrictSNIVHostCheck on"). If the JSONP request fails by timing out, we redirect the customer to the nonSNI domain.

To further complicate matters, we do not want to redirect everyone just because the SNI_TEST_DOMAIN is down. If the JSONP request fails (by timing out since there's no way to detect a JSONP failure directly), we verify that the server is available by doing an HTTP "health-check" request. In addition, we do not want to run this javascript code on every page load, since that increases the chance of some strange timeout and incorrectly redirecting many customers, so we set a session variable once the SNI check is done so it won't happen again as the customer navigates the sites.

We know that we get certain false checks that fails due to the JSONP timeout being unreliable, but since implementing this we are getting no complaints from customers.

var redirect='http://REPLACE_WITH_NON_SNI_URL';

var sni_https_timeout, sni_http_timeout;
var https_req = $.ajax({
    url : 'https://SNI_TEST_DOMAIN.com/snitest.php',
    dataType : "jsonp",
}).done(function() {
        window.clearTimeout(sni_https_timeout);
        var request = $.ajax({
        url: "index.php?ua=sni_check_done",
       type: "POST"
    });
})

sni_https_timeout = window.setTimeout(function() {
    var http_req = $.ajax({
        url : 'http://SNI_TEST_DOMAIN/sni_healthcheck.php',
        dataType : "jsonp"
    }).done(function()
        {
            window.clearTimeout(sni_http_timeout);
            window.setTimeout(function()
            {
                window.location = redirect;
            },
        200);
    });

    sni_http_timeout = window.setTimeout(function() { sni_http_fail(); }, 8000);

}, 8000);

function sni_http_fail() {
    var request = $.ajax({
        url: "index.php?ua=sni_check_done",
        type: "POST"
    });
}

snitest.php / sni_healthcheck.php:

<?php
if (array_key_exists('callback', $_GET))
{
    header( 'Content-type: application/javascript' );
    echo "{$_GET['callback']}();\n";
}
ronneseth
  • 1,029
  • 7
  • 9
  • 13
    This is a very good answer. In depth, and with description of a real-life implementation. – MEMark Mar 14 '14 at 11:40
  • 1
    Very great response. Do you have updates of figures for SNI-support percentage ? (one year later) :) – kheraud Jan 26 '15 at 19:19
  • I presume you have to use a domain with no sensitive cookies or data as the SNI_TEST_DOMAIN, to prevent JSON hijacking or CSRF or XSS? – Janus Troelsen Feb 15 '15 at 20:43
  • Janus - Yes, you are correct, no cookies or session store related to SNI_TEST_DOMAIN. – ronneseth Mar 17 '15 at 23:08
  • @iwalktheline: IE8 affected by SNI has dropped to less than 2.3 %. To re-iterate, 85 % of our traffic originates from North America. – ronneseth Mar 17 '15 at 23:36
  • At this time, we completely removed support for nonSNI clients and we have not received a single complaint. We have hundreds of sites taking traffic from over 3M users per month (mostly originating from North America). – ronneseth Apr 28 '16 at 20:54
  • Long answer that barely addresses the question. – jeffmcneill Jan 25 '20 at 09:24
19

The Wikipedia article you referenced lists the supported browser and server versions. Internet Explorer 7 (Vista or higher, not XP) or later and Mozilla Firefox 2.0, for example. Unless you know all your visitors are using supported browsers, you can't use SNI (with multiple certificates on one IP address) without cutting them off from the SSL portion of your site.

Robert
  • 2,341
  • 18
  • 11
  • 3
    it's not really "cutting them off" — it's just a warning to the user. – John Bachir Nov 10 '11 at 01:24
  • 10
    (which is bad UX and breaks the https security/trust model) – John Bachir Nov 10 '11 at 01:25
  • @JohnBachir could you expand on why you think it breaks the https security/trust model. If a server can't determine which site a browser it trying to contact it refuses the connection - surely that maintains security. I agree it's bad UX, but I don't see the security problem - am I missing something? – Peter Bagnall Jan 09 '13 at 09:34
  • 6
    The user can say "continue anyway". So, seeing the warning is bad UX, and saying "continue anyway" is bad security. But the user can still access those resources. (i haven't explored this in a long time but i'm assuming that's the case based on my comment from '11) – John Bachir Jan 09 '13 at 21:01
  • any new statistics on this one? – Jay Mar 29 '14 at 13:05
  • 3
    Using an old browser/OS that does not support SNI is already not secure! If browser doesn't support TLS (SNI is an extension of TLS), you can't help them stay safe, cause SSL is already outdated in terms of security. – DUzun Sep 07 '14 at 15:47
  • it seems the bad UX is caused by the users choice of non-compliant, non updated, insecure user agents, not from anything wrong with the site. And using such browsers, the user should be not only prepared for lots of bad UI, but expecting it. – stephenbayer Oct 21 '14 at 15:17
9

The problem is windows XP clients and Android < 3.0 clients. Unfortunately combined they are still nearly 10% of visitors to many of our websites. In addition, while Blackberry users are a low volume, they are some of our paying customers. XP, Blackberry and Gingerbread combined make SNI not acceptable at most of our websites at this time (Feb 2015). I expect this problem to diminish in about a year or two.

Update on Nov 2016 (21 months later): Going on a fairly standard site with ~10,000 visits/mo. Jan 2013 ~10% non-SNI. Jan 2014 ~6%, Jan 2015 <2%, Jan 2016 ~0.5%, Nov 2016 ~0.1% (1 in 1,000). We did the cutover in Nov/Dec 2015. However, certain markets may have a greater number of these users. I created custom audiences in Google Analytics, so it is easy to see the impact. Just define by OS name,version starts with, and for XP, browser is IE.

jeffmcneill
  • 2,052
  • 1
  • 30
  • 26
  • 1
    Thank you for researching this on your site. Could you please post an update on these numbers? What percentage remains currently? Many thanks! – mat Nov 12 '16 at 13:28
5

Internet explorer (all versions; 6, 7 and 8) on Windows XP do not support SNI. All the others work. I don't really know how many users on XP use Internet explorer but that's the magic number of users that cannot use SNI .

Mobile Support :

Android default browser on Honeycomb or newer      
Windows Phone 7
MobileSafari in Apple iOS 4.0 or later
Robbietjuh
  • 848
  • 1
  • 8
  • 22
themihai
  • 7,903
  • 11
  • 39
  • 61
  • 1
    I think we'd all figured out that modern versions were working fine. The issue is to figure out how many don't match these criteria. Windows XP is getting old but it's still present. There are definitely a number of a Android 2.x handsets around that are not so old. Plenty of users don't change their phones to get the latest gadget (they may also be tied in 2-year contracts with their carrier). SNI's not ready for this part of the market unfortunately. The question is more about stats. Do you have any? – Bruno Mar 30 '12 at 01:07
  • I think the stats depend by your your user profile (e.g. would your customer have a XP machine or do you care about XP users, I doubt that SO for example would care about IE7 ). The only solution would be to do browser/os detection and redirect those with incompatible browser to a traditional SSL enabled page while the majority will use the default SNI enabled page. I suppose you need SNI as it's cheaper/cloud-enabled so I think the browser detection it's a good trade-off. – themihai Mar 30 '12 at 05:33
  • 5
    You can't do any browser detection before the SSL/TLS connection is established. – Bruno Mar 30 '12 at 10:20
  • I suppose that you redirect the users to the SSL page... at least in my case I use SSL for auth so before to redirect the user (based on his auth cookies) I check the browser/os. – themihai Mar 30 '12 at 15:50
  • Like Bruno said, you cannot do any detection before the connection is established, as the detection has to happen from a client side script, which will be sent over the connection. The bottom line is, the connection establishment is the first thing that will happen. – talonx Sep 17 '12 at 12:23
  • 2
    @talonx I assumed that the client is redirected from a non-ssl page owned by you so before to redirect the user on the SSL page (perhaps for authentication) you can check his browser isn't is ? btw : google dropped support for IE8 hurrah ! – themihai Sep 18 '12 at 10:47
  • @mihai, your comments about hosting a HTTP page to do the browser checking and then redirecting the user to HTTPS only if the browser supports SNI is great! For browsers that do not support SNI, you can even incentivize the user to use some other browser that does support it. Thanks for sharing it. – pagliuca Oct 30 '12 at 10:32
  • @pagliuca Vote my comment if it helps! The Bruno guy got more votes :(( – themihai Nov 14 '13 at 12:43
  • Worth noting that Facebook now forces users to use secure connections while browsing on the site. The have now revoked the ability to change this setting. This is important for any fb app developers. The above redirection technique wouldn't even work there. To SNI or not to SNI. Just to be safe, especially with Facebook apps, might just be worth it to get another ip. Rackspace does not charge for additional ips. SNI will hopefully eventually be a solid solution. – Dante Cullari Dec 12 '13 at 09:48
3

Yes

You will not be able to support SSL connections from XP with SNI. However, allowing XP clients to connect doesn't conform to some standards anyway, so you may have to drop these users for other reasons.

They are just a few percent in 2016 and dropping. If you must support every user with SSL, then you will need to dynamically switch, but if you just need the vast majority ... sure.

DigitalRoss
  • 143,651
  • 25
  • 248
  • 329
2

I am late in answering this, but for all readers who may be interested in this kind of solution. Just detect the browser and OS using server-side feature and tell the visitor to use "Install and use secure browser for shopping online like Chrome or Firefox and provide a link to download and install."

This is best way to make shopping secure for your customer and this serves two purposes, one SNI enabled SSL usage and making customer's "shopping secure." Because those outdated browsers on XP are really not safe irrespective of server using SNI enabled SSL or not.

We can risk this, because the percentage of users using older IE versions on XP are below 5% in US and it is negligible or zero in other countries. In fact people in other countries people are used to Open Source browsers.

My own experience, I host many websites for myself as well as many clients and I have SSL for all of them using SNI technology without dedicated IP and I am quite sure that people have shifted to chrome or firefox in many countries, almost all of them and in US, 95% of them.

Forgive me for any inaccurate information.

LuckyBabu
  • 69
  • 2
  • 9
  • 1
    Detecting based on the user-agent can't always work. When the browser doesn't support SNI, it won't send the right name, won't get the right cert in return, won't validate that cert and thus won't even establish the connection, so no HTTP traffic will take place, so no user agent will be sent. – Bruno Aug 20 '14 at 13:51
  • It would be true if SSL is enabled for whole website, but usually that is not the case, SSL is enabled only for secure pages like login, checkout etc. but yes, this wont happen or maybe possible, I dont have know how about it. – LuckyBabu Aug 20 '14 at 14:03
1

http://caniuse.com/#feat=sni currently says SNI is supported on 97.6% of browsers.

Bryan Legend
  • 6,790
  • 1
  • 59
  • 60
  • Browsers is different from visitors to a site, which can skew based on demographics. Sites I'm working with are now under 0.1% (1 in 1,000), therefore 99.9% SNI supported. (this is one year later, Nov 2016). – jeffmcneill Nov 23 '16 at 08:50
0

I think there are two aspects of this, the UI and the detection part.

UX

<!--[if lt IE 7]>
   <div>You're using a browser that has high security risks (SSL, XSS, etc). Please consider upgrading it.</div>
<![endif]-->

It's clear that anyone using IE6 or below has high chances to be on Windows XP and not supporting SNI. The other who spoof their user-agent don't matter here.

Server side

  1. Sniff for the user-agent. Will come up with regexes after the unit tests are done.
  2. Use the AJAX implementation above.

Special note

Using the AJAX solution gives you a 99% bullet proof detection but does not conform with a couple of web dev principles.

  • Progressive Enhancement - you are giving the same AJAX request to all the users. Users who support SNI should not be bothered.
  • Legacy - you cannot deprecate this code easely.
  • If you are using jQuery with your AJAX requests, you might impact your code depends on $.ajaxStop() method.
Șerban Ghiță
  • 1,899
  • 20
  • 21