Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript NodeJs和HTTPS:如何使用;“企业社会责任”;及;PEM“;来自globalSign的数据_Javascript_Node.js_Https_Certificate_Ssl Certificate - Fatal编程技术网

Javascript NodeJs和HTTPS:如何使用;“企业社会责任”;及;PEM“;来自globalSign的数据

Javascript NodeJs和HTTPS:如何使用;“企业社会责任”;及;PEM“;来自globalSign的数据,javascript,node.js,https,certificate,ssl-certificate,Javascript,Node.js,Https,Certificate,Ssl Certificate,我有一个使用标准https.createServer方法创建的nodeJs http服务器(Windows)。我想使用从GlobalSign获得的证书。他们给了我一个“csr”和一个“pem”。我将它们保存在文本文件中并尝试使用它们: this.fHttpServer=https.createServer({ 键:“csrFileFromGlobalSign”, 证书:“pemFileFromGlobalSign” }); 但它在nodeJs中给了我一个“执行错误”:“错误:0906D06C

我有一个使用标准https.createServer方法创建的nodeJs http服务器(Windows)。我想使用从GlobalSign获得的证书。他们给了我一个“csr”和一个“pem”。我将它们保存在文本文件中并尝试使用它们:

this.fHttpServer=https.createServer({
键:“csrFileFromGlobalSign”,
证书:“pemFileFromGlobalSign”
});
但它在nodeJs中给了我一个“执行错误”:“错误:0906D06C:PEM例程:PEM_read_bio:无起始行”

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

我遗漏了什么?

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

谢谢您的回答。我可以提取“cert”文件,但无法额外提取“key”文件,我尝试了
openssl rsa-outform der-in file.pem-out file.key
,但openssl会生成一个错误您需要“nocerts”选项来输出密钥openssl pkcs12-in filename.pem-nocerts-out key.pem'