字段
字段 | 类型 | 描述 |
insecureSkipVerify | boolean | 控制客户端是否验证服务器的证书链和主机名;如果为真,crypto/tls 接受服务器提供的任何证书以及该证书中的任何主机名 |
rootCAs | Array | 根证书 |
certificates | Array | 客户端证书列表 |
serverName | string | 匹配证书里的主机名 |
样例
使用 TLSConfig:
export const option = {tlsConfig: {'localhost': {insecureSkipVerify: false,rootCAs: [open('ca.crt')],certificates: [{cert: open('client.crt'),key: open('client.key')}],serverName: "xxx.com"}}}