Search code examples
hyperledger-fabrichyperledger-fabric-ca

How to start fabric-ca server with tls enabled


I tried to start the fabric-ca server with tls enabled. Done changing the tls enabled to true in fabric-ca-server-config.yaml file. Also tried starting the fabric-ca-server with the following commands:

fabric-ca-server start --ca.certfile /root/bcnetwork/conf/crypto-config/peerOrganizations/org0/ca/ca.org0-cert.pem --ca.keyfile /root/bcnetwork/conf/crypto-config/peerOrganizations/org0/ca/8dbc8fbc5ee4496541a5cf71dac87672c492e1820f30993cbe3d4f7109e50a91_sk -b admin:adminpw

With peer cert and key files:

fabric-ca-server start -b admin:adminpw --tls.enabled --tls.certfile /root/bcnetwork/conf/crypto-config/peerOrganizations/org0/peers/peer2.org0/tls/server.crt --tls.keyfile /root/bcnetwork/conf/crypto-config/peerOrganizations/org0/peers/peer2.org0/tls/server.key

But getting the following error:

Error: read ../github.com/hyperledger/fabric-ca/server: is a directory

I already set the paths:

FABRIC_CA_HOME=../github.com/hyperledger/fabric-ca/server

Solution

  • You have to set tls.certfile and tls.keyfile in the environment variables of the fabric-ca server while you have enabled tls to true. But the error is not because of that but because of the incorrect mapping of the fabric-ca directory which have the certificate and key file.