带有节点JS的Spring Boot SSL

时间:2018-10-09 07:30:19

标签: node.js spring-boot ssl

nodeJS项目应与Spring boot SSL项目通信。在NodeJS方面,我们有一个.crt和.key文件。在FRom Spring引导项目侧,如何使用这两个而不是使用密钥库和密码来启用SSL。弹簧靴侧的当前配置:

server.port=8443
server.ssl.key-store=classpath:keystore.pfx
server.ssl.key-store-password=pass

Node JS代码:

new https.Agent({ 
  httpsAgent: new https.Agent({
      rejectUnauthorized: true,
      cert: fs.readFileSync(process.env.CERT_PATH, 'utf8'),
      key: fs.readFileSync(process.env.KEY_PATH, 'utf8')
  })
});

错误:

错误:错误:无法验证第一个证书, 错误:错误(stacktrace)>错误:无法验证第一个证书,  在TLSSocket.onConnectSecure(_tls_wrap.js:1048:34)

0 个答案:

没有答案