简体   繁体   中英

Can I detect browser's TLS Version via Code?

I want to show some warning message on browsers which has the TLS version 1.0 or older. How will I determine the TLS Version of Browser via Code ? I can have access to User Agent String. I don't think it's mentioned there.

Link to TLS Version for all the major browsers. Please refer the Table.

Thanks in advance !!!

The TLS parameters are negotiated during the TLS handshake (when you initially connect to the site) and depend on the browser and server capabilities.

I don't believe browsers offer ways to programmatically query this information. Nor do I think your site should be warning users about the TLS connection. This is really the job of the browser. Why should users trust your site to correctly display that information?

All modern browsers allow users to inspect the TLS parameters of the connection. Chrome for example shows this info in the security tab under developers tools.

Your best option is to disable insecure TLS versions on the server.

Having said that, you could of course build code server side to expose this information or subscribe to something like https://www.howsmyssl.com/s/api.html which does this for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM