Search code examples
hyperledger-fabrichyperledgerhyperledger-fabric-ca

Fabric when register the user give error Error: Calling register endpoint failed with error [Error: unable to verify the first certificate]


I am running the fabric ca using the docker container, When i enrolled the admin, It's works well, But when i am trying to register the new user, its throws the error, as shown below. I am using fabric node to enroll and register the users.

Error: Calling register endpoint failed with error [Error: unable to verify the first certificate]

docker file

ca0:
image: hyperledger/fabric-ca
environment:
  - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
  - FABRIC_CA_SERVER_TLS_ENABLED=true
  - FABRIC_CA_SERVER_CA_NAME=ca.example.com
ports:
  - "7054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
volumes:
  - ./fabric-ca-server/fabric-ca-server-config.yaml:/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
container_name: ca_peerOrg1
networks:
  - byfn

In my node connection.json

 "certificateAuthorities": {
    "ca.example.com": {
        "url": "https://127.0.0.1:7054",
        "caName": "ca.example.com"
    },

Solution

  • You are missing tlsCACerts parameter in your connection.json to allow your CA TLS certificate.