目前的问题是p12文件的加密方式sha1在
at configSecureContext (node:internal/tls/secure-context:290:15)
at Object.createSecureContext (node:_tls_common:114:3)
at Object.connect (node:_tls_wrap:1764:48)
at Agent.createConnection (node:https:173:22)
at Agent.createSocket (node:_http_agent:330:26)
at Agent.addRequest (node:_http_agent:278:10)
at new ClientRequest (node:_http_client:340:16)
at Object.request (node:https:381:10)
at Object.requestWithCallback (D:\workspace-vscode\qingyalive\node_modules\urllib\lib\urllib.js:1051:19)
at D:\workspace-vscode\qingyalive\node_modules\urllib\lib\urllib.js:162:13
at new Promise (<anonymous>)
中不支持,nodejs从10.0版本就不支持p12文件的加密方式sha1,我们的服务器对nodejs版本的要求在10.0以上。
后端调用:let result = await api.transfers({
partner_trade_no: no,
openid: openid,
//re_user_name: userName,
amount: price * 100,
check_name: "NO_CHECK",
desc: '提现'
});
出现异常:
nodejs.ERR_CRYPTO_UNSUPPORTED_OPERATIONError: Unsupported PKCS12 PFX data, POST https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers -1 (connected: false, keepalive socket: false, socketHandledRequests: 0, socketHandledResponses: 0
pfx配置在下面
pfx: require('fs').readFileSync('app/public/cert/apiclient_cert.p12'),
目前的问题是p12文件的加密方式sha1在 at configSecureContext (node:internal/tls/secure-context:290:15) at Object.createSecureContext (node:_tls_common:114:3) at Object.connect (node:_tls_wrap:1764:48) at Agent.createConnection (node:https:173:22) at Agent.createSocket (node:_http_agent:330:26) at Agent.addRequest (node:_http_agent:278:10) at new ClientRequest (node:_http_client:340:16) at Object.request (node:https:381:10) at Object.requestWithCallback (D:\workspace-vscode\qingyalive\node_modules\urllib\lib\urllib.js:1051:19) at D:\workspace-vscode\qingyalive\node_modules\urllib\lib\urllib.js:162:13 at new Promise (<anonymous>) 中不支持,nodejs从10.0版本就不支持p12文件的加密方式sha1,我们的服务器对nodejs版本的要求在10.0以上。