Detect browser TLS compatibility
There are at least two web sites that will check the browser capabilities for you, including SSL Labs (https://www.ssllabs.com/ssltest/viewMyClient.html) and HowsMySSL (https://www.howsmyssl.com/). HowsMySSL also has a nice API that can be easily checked from JavaScript.
You can use the API provided by How's my SSL?.
In the following example, I check the tls_version
. Checking given_cipher_suites
may also be a good idea.
<script>
window.parseTLSinfo = function(data) {
var version = data.tls_version.split(' ');
console.log(
version[0] != 'TLS' || version[1] < 1.2
? 'So bad! Your browser only supports ' + data.tls_version + '. Please upgrade to a browser with TLS 1.2 support.'
: 'All OK. Your browser supports ' + data.tls_version + '.'
);
console.log(data);
};
</script>
<script src="https://www.howsmyssl.com/a/check?callback=parseTLSinfo"></script>