【问题标题】:Custom Details(Country, State, Locality) for MSP in Organisation MSP of Hyperledger FabricHyperledger Fabric 组织 MSP 中 MSP 的自定义详细信息(国家、州、地区)
【发布时间】:2019-01-09 08:27:12
【问题描述】:

Hyperledger Fabric Documentation 声明我们可以添加其他参数,即组织的规格和 CA。该示例显示可以注释掉附加代码以提供值。

我正在尝试做的事情:

  • 我需要在组织的 X509 证书中提供 Country、State、Locality 的自定义值。
  • 我正在使用“cryptogen”工具生成证书。
  • 以下是来自 crypto-config.yaml 文件的组织的 sn-p:

    -&Org1
    
        Name: Org1MSP
        ID: Org1MSP
        MSPDir: crypto-config/peerOrganizations/org1.example.com/msp
        CA:
           Hostname: ca
           Country: Westros
           Province: North
           Locality: Winterfell
           OrganizationalUnit: HouseStark
           StreetAddress: NorthernStreet
           PostalCode: 30000
        Policies:
            Readers:
                Type: Signature
                Rule: "OR('Org1MSP.admin', 'Org1MSP.peer', 'Org1MSP.client')"
            Writers:
                Type: Signature
            Rule: "OR('Org1MSP.admin', 'Org1MSP.client')"
            Admins:
                Type: Signature
                Rule: "OR('Org1MSP.admin')"
        AnchorPeers:
            - Host: peer0.org1.example.com
              Port: 7051
    

生成证书时遇到的错误:

2019-01-09 13:44:50.557 IST [common/tools/configtxgen/localconfig] 加载 -> PANI 003 将配置解组为结构时出错:3 错误 (s) 解码:

  • 'Organizations[1]' 的密钥无效:CA
  • “Profiles[TwoOrgsChannel].Application.Organizations[0]”有无效的键:CA
  • 'Profiles[TwoOrgsOrdererGenesis].Consortiums[SampleConsortium].Organizations[0]' 具有无效键:CA

我尝试过的:

  • 首先,我尝试了上述配置,结果出错。
  • 我再次阅读了cryptogen工具的用法。我曾经cryptogen showtemplate 来检查用于生成证书的模板。它的格式与我的 crypto-config.yaml 文件类似。
  • 保持配置简单,即没有 CA 详细信息,我启动了网络,进入 fabric-ca-server 容器并更新了fabric-ca-server-config.yaml 以提供 CA 的值。这导致了其他错误。我认为这是因为我使用一些 X CA 配置使用 cryptogen 生成了证书,并且在运行时我放置了一些 Y CA 配置。

我有什么遗漏或做错了吗?

【问题讨论】:

    标签: hyperledger-fabric hyperledger-fabric-ca


    【解决方案1】:

    我重新安装了 fabric 1.4 的二进制文件并在 crypto-config.yaml 中定义了以下内容:

    # Setting up orderer of the network
    OrdererOrgs:
    
      - Name: Orderer
        Domain: example.com
        CA:
          Country: IN
          Province: Karnataka
          Locality: Bengaluru
        Specs:
         - Hostname: orderer
    
    # Setting up peer orgs of the network
    PeerOrgs:
    
     - Name: Org1
       Domain: org1.example.com
       EnableNodeOUs: true
       CA:
         Country: IN
         Province: Karnataka
         Locality: Bengaluru
       # Template count is the number of peer nodes for this organization
       Template:
         Count: 2
    
       Users:
         Count: 1
    

    我为用于 CSR 的 SubjectDN 提供了错误的值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-23
      • 1970-01-01
      • 2015-09-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多