Search code examples
javascriptsslbrowser-detectionbrowser-security

Javascript: How to check whether particular TLS version is enabled in browser or not?


I would like to check for example whether TLS 1.0/1.1/1.2 is enabled in a browser or not. How can I check that using Javascript?


Solution

  • There is no way to check the capabilities of the browser regarding TLS only from within the browser itself. You need at least to make a https connection to some server which then echos the information from the successful handshake back to you.

    How this can exactly be done depends on the server, but for apache you get access to the TLS version from the SSL_PROTOCOL environment variable. Of course this only provides common version between client and server, that is if your server can to only TLSv1 but the browser can do TLSv1.2 the common version will only be TLSv1.