Hyperledger Fabric SDK - https & TLS Cert / Key

梦想与她 提交于 2019-12-05 13:09:09

The answers below are w.r.t. the Node SDK but hope they shed some light on the question

1) The most simplistic way to secure (https) a connection between the SDK (client) and the CA / peer / orderer?

The node sdk does not support communicating with a fabric ca server that has clientauth (aka mutual TLS) enabled [1]

The TLS certificate provided by a (TLS enabled) server is validated against the certificate in tlsCACerts. The validation process can be thought of as running below command:

openssl verify -CAfile <tlsCACerts> <cert-provided-by-server>

The tlsCACerts property is set per peer, orderer and fabric ca server in the network-config.yaml file - all of them could use different tlsCACerts if they wanted.

For the peer and orderer, the node sdk does support clientauth (or mutual TLS) but it has to be setup in code not the config file as described in [2] - see the section where they show how to use client.setTlsClientCertAndKey(cert, key)

The statement in the question that

tlsCACerts section is for mutual TLS connections

is wrong.

2) Why we are hard-coding TLS cert/key filepaths into the config file when these should be refreshed very often when use in production?

I don't think these would be refreshed very often. And if they were, then, ironically, config would be the right place IMO.

This statement in the question

mutual TLS should not be needed for an https connection (most browsers don't use mutual TLS to secure the connection).

is correct. Mutual TLS enables bi-directional verification i.e., the server also validates the client. In one-way TLS, it is only the client that validates the server.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!