【问题标题】:NodeJs and HTTPS : how to use the "CSR" and "PEM" datas from globalSignNodeJs 和 HTTPS:如何使用来自 globalSign 的“CSR”和“PEM”数据
【发布时间】:2019-01-02 21:43:59
【问题描述】:

我有一个使用标准 https.createServer 方法创建的 nodeJs http 服务器 (Windows)。我想使用从 GlobalSign 购买的证书。他们给了我一个“csr”和一个“pem”。我将它们保存在一个文本文件中并尝试使用它们: this.fHttpServer=https.createServer({ key: 'csrFileFromGlobalSign', cert: 'pemFileFromGlobalSign' }); 但它在 nodeJs 中给了我一个“执行错误”:“error:0906D06C:PEMroutines:PEM_read_bio:no start line”

  • 我尝试切换文件,同样的问题
  • 如果我尝试使用 openSSL 生成的文件,它可以工作(没有错误)

我错过了什么?

【问题讨论】:

    标签: javascript node.js https certificate ssl-certificate


    【解决方案1】:

    如果我理解正确,则必须使用openssl 从 pem 文件中提取密钥和证书。稍后将 key.pem 设置为 key,将 cert.pem 设置为 cert。

    【讨论】:

    • 感谢您的回答。我可以提取“证书”文件,但无法提取“密钥”文件,我尝试了 openssl rsa -outform der -in file.pem -out file.key,但 openSsl 生成错误
    • 您需要 'nocerts' 选项来输出密钥。 'openssl pkcs12 -in filename.pem -nocerts -out key.pem'
    猜你喜欢
    • 1970-01-01
    • 2014-06-26
    • 1970-01-01
    • 2021-02-27
    • 2017-11-13
    • 1970-01-01
    • 2017-01-10
    • 2021-03-23
    • 2019-10-06
    相关资源
    最近更新 更多