问题描述
使用带有“Authentication”=“Certificate”的 API 的 PEM 文件存在以下错误
关于邮递员:
PEM routines:OPENSSL_internal:NO_START_LINE
在github节点js示例上:
node:_tls_common:155
context.setCert(cert);
^
Error: error:0909006C:PEM routines:get_name:no start line
at setCerts (node:_tls_common:155:13)
at Object.createSecureContext (node:_tls_common:210:7)
at Object.connect (node:_tls_wrap:1591:48)
at Agent.createConnection (node:https:129:22)
at Agent.createSocket (node:_http_agent:323:26)
at Agent.addRequest (node:_http_agent:274:10)
at new ClientRequest (node:_http_client:314:16)
at Object.request (node:https:313:10)
at Object.<anonymous> (/Users/kthxbai/Downloads/index.js:25:7)
at Module._compile (node:internal/modules/cjs/loader:1108:14) {
library: 'PEM routines',function: 'get_name',reason: 'no start line',code: 'ERR_OSSL_PEM_NO_START_LINE'
}
解决方法
我相信您的证书 PEM 文件中没有导致错误的以下几行。
-----开始证书--
...<your cert>...
-----结束证书-----