zoukankan      html  css  js  c++  java
  • 浏览器证书问题,chorm,ie,edge,safari都会去读系统证书,firefox例外

    坑爹

    没想过浏览器兼容的问题。

    为系统安装用户证书后, firefox一直无法连接

    提示

    连接 www.httpsserver.com:8985 时发生错误。 SSL 对等端无法协商出一个可接受的安全参数设置。 (错误码: ssl_error_handshake_failure_alert)

    您尝试查看的页面无法显示,因为已收到数据的可靠性无法证实。
    请联系网站的所有者,告知他们这个问题。

    我一直找不到问题在哪里。

    写代码导入证书,OK可以访问

    var options = {
        hostname:'www.httpsserver.com',
        port:8985,
        path:'/',
        method:'GET',
    //    key:fs.readFileSync('client.key'),
    //    cert:fs.readFileSync('client.crt'),
    //    ca: [fs.readFileSync('ca.crt')],
        pfx:fs.readFileSync('client.pfx'),
        passphrase:"1CUI"
    };
    
    options.agent = new https.Agent(options);
    var req = https.request(options,function(res){
        console.log("statusCode: ", res.statusCode);
        console.log("headers: ", res.headers);
    
        res.setEncoding('utf-8');
        res.on('data',function(d){
            console.log(d);
        })
    });
    
    req.end();
    
    req.on('error',function(e){
        console.log(e);
    })

    可以访问成功。

    但把证书安装到系统,在firefox访问,却不行。

    百思不得其解。

    然后用chorme ,成功了。

    原来firefox有自已的证书和信任管理模块。装到系统里不生效,必须手动导入到firefox里!!!!!!

  • 相关阅读:
    nginx开启ssl模式
    安装nginx
    node的express框架
    使用Thumbnails工具对图片进行缩放,压缩
    正则
    VUE设置全局方法和属性
    js——XHR知识归纳
    页面资源加载过程
    Mongodb的增删改查
    Mongodb基本概念
  • 原文地址:https://www.cnblogs.com/zihunqingxin/p/4630667.html
Copyright © 2011-2022 走看看