Search code examples
hyperledger-fabrichyperledger-fabric-ca

How to configure L, ST, C... propeties in my Fabric certificates when creating the Fabric network?


I see this logs in my peer node:

2019-12-06 12:47:51.496 UTC [comm.grpc.server] 1 -> INFO 8c9 streaming call completed grpc.service=gossip.Gossip grpc.method=GossipStream grpc.peer_address=10.244.0.1:35758 grpc.peer_subject="CN=blockchain-hapeer1.mydomain.net,L=San Francisco,ST=California,C=US" error=EOF grpc.code=Unknown grpc.call_duration=1.803311ms

I have not configured L, ST or C in my certificate creation process (cryptogen and configtxgen commands). Where should I configure that so the certificate is generate not with those default values (San Francisco, California, ...) but with the correct ones for my country and organization? configtx.yaml... crypto-config.yaml ?


Solution

  • It should go in crypto-config.yaml: https://github.com/hyperledger/fabric-sdk-py/blob/master/test/fixtures/e2e_cli/crypto-config.yaml.

    Anyway, you usually don't care much about that until something more similar to a pre-production environment, and in that case you should use a CA (normally Fabric-CA) instead of cryptogen. When using Fabric-CA, you must check fabric-ca-server-config.yaml in the CA itself (in its FABRIC_CA_SERVER_HOME) and fabric-ca-client-config.yaml in its client (in its FABRIC_CA_CLIENT_HOME).