检测浏览器TLS兼容性 [英] Detect browser TLS compatibility

查看:165
本文介绍了检测浏览器TLS兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个SSL网站,主机最近禁用了较旧的SSL协议,如TLS 1.0及更低版本。如果浏览器使用的浏览器至少不支持TLS 1.1,则网站访问者在访问网站时会看到空白页或隐藏的错误消息,具体取决于浏览器。

We have a SSL website where the host has recently disabled older SSL protocols like TLS 1.0 and below. Depending on the browser, the site visitor gets a blank page or a cryptic error message when they visit the site if the browser they are using does not support at least TLS 1.1.

我希望创建一个不在SSL端口上的登录页面,如果它支持TLS 1.1及更高版本,我可以检测浏览器功能。如果没有,那么我想向他们展示一个友好的消息,以升级他们的浏览器或使用不同的浏览器。

I was hoping to create a landing page that is not on the SSL port and where I can detect the browser capability if it supports TLS 1.1 and above. If it doesn't then I want to show them a friendly message to upgrade their browser or use a different browser.

这是否可以使用客户端javascript完成图书馆?如果是这样,那么我应该使用什么。

Is this something that can be accomplished using client side javascript library? If so, then what should I be using.

谢谢。

推荐答案

您可以使用 API .howsmyssl.comrel =noreferrer>我的SSL怎么样?。

You can use the API provided by How's my SSL?.

在下面的例子中,我检查 tls_version 。检查 given_cipher_suites 也可能是一个好主意。

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>

这篇关于检测浏览器TLS兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆