注意:我使用的是Go SDK,但这应该适用于Node,Java等SDK .
我使用 fabric-ca
实例作为我的证书颁发机构,对于真实的 生产环境 环境,我需要使用安全连接 .
基于 config-e2e.yaml
示例配置文件[1],我们应该能够在CA URL中使用 https
. 例:
certificateAuthorities:
org1-ca:
url: https://localhost:7054
但是,一旦需要 https
,SDK就要求在 client
部分[1]中添加TLS证书/密钥文件路径:
tlsCACerts:
# Comma-Separated list of paths
path: {filepath}
# Client key and cert for SSL handshake with Fabric CA
client:
key:
path: {filepath}
cert:
path: {filepath}
但是,其他文档[2]表明 tlsCACerts
部分用于相互TLS连接,并且基于我对TLS [3]的有限理解, https
连接不应该需要相互TLS(大多数浏览器不使用相互TLS连接保护连接) .
有人能解释一下:
1)保护(https)SDK(客户端)和CA / peer / orderer之间连接的最简单方法?
2)为什么我们将TLS证书/密钥文件路径硬编码到配置文件中时,如果在 生产环境 中使用它们时应经常刷新?
注意:This question/answer似乎表明您不需要相互TLS进行安全连接,但如果我将 https:
添加到我的CA网址,我会收到错误,直到我填写 tlsCACerts
部分 .
[1] https://github.com/hyperledger/fabric-sdk-go/blob/master/test/fixtures/config/config_e2e.yaml
[2](参见"client authentication"与服务器端TLS设置)https://hyperledger-fabric.readthedocs.io/en/release-1.2/enable_tls.html
[3] http://www.cafesoft.com/products/cams/ps/docs32/admin/SSLTLSPrimer.html