Rubber Duck Rubber Duck - 6 months ago 68
HTML Question

Detect if browser has TLS enabled

Is there a way to check if a browser has TLS enabled?

I'm limited to using HTML and Javascript.

Answer

In Javascript, utilizing ActiveX, and intended for IE7,

(function(){
var key = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\SecureProtocols";
var t = document.getElementById("detectREG_output");
var Shell = new ActiveXObject("WScript.Shell");
var value = Shell.RegRead(key);
t.innerHTML = value;
})();

This outputs a bitfield, with decimals equating to:

168 = SSL 3.0, SSL 2.0, TLS 1.0 Enabled

160 = SSL 3.0, TLS 1.0 Enabled

40 = SSL 3.0, SSL 2.0 Enabled

8 = SSL 2.0 Enabled

0 = None are enabled

MSDN on IE7 and HTTPS