Hyperledger fabric 错误-“;路径长度约束的中间产物太多“;何时注册新身份

Hyperledger fabric 错误-“;路径长度约束的中间产物太多“;何时注册新身份,hyperledger-fabric,hyperledger-fabric-ca,Hyperledger Fabric,Hyperledger Fabric Ca,在hyperledger fabric ca中,我创建了ca链,如: 根钙-中间钙1-中间钙2-中间钙3 有了这些ca,我在fabric-ca-config.yaml文件的“signing”部分设置了“maxpathlen:5”,在“csr”部分设置了“pathlength:5” 这意味着我的链至少对4个中间CA有效,并且我可以在中间CA 3中注册新身份 事实上,我可以注册中间CA 3的管理员,但是,当我注册新身份时,我有以下错误: /register 401 26“不受信任的证书:验证证书失败

在hyperledger fabric ca中,我创建了ca链,如:

根钙-中间钙1-中间钙2-中间钙3

有了这些ca,我在fabric-ca-config.yaml文件的“signing”部分设置了“maxpathlen:5”,在“csr”部分设置了“pathlength:5”
这意味着我的链至少对4个中间CA有效,并且我可以在中间CA 3中注册新身份

事实上,我可以注册中间CA 3的管理员,但是,当我注册新身份时,我有以下错误:

/register 401 26“不受信任的证书:验证证书失败:x509:路径长度约束的中间产物太多”

我做错了什么,以及如何配置此值
我的配置文件

# Version of config file
version: 1.1.0

# Server's listening port (default: 7054)
port: 7054

# Enables debug logging (default: false)
debug: false

# Size limit of an acceptable CRL in bytes (default: 512000)
crlsizelimit: 512000

tls:
  # Enable TLS (default: false)
  enabled: false
  # TLS for the server's listening port
  certfile:
  keyfile:
  clientauth:
    type: noclientcert
    certfiles:

ca:
  # Name of this CA
  name:
  # Key file (is only used to import a private key into BCCSP)
  keyfile:
  # Certificate file (default: ca-cert.pem)
  certfile:
  # Chain file
  chainfile:

crl:
  # Specifies expiration for the generated CRL. The number of hours
  # specified by this property is added to the UTC time, the resulting time
  # is used to set the 'Next Update' date of the CRL.
  expiry: 24h

registry:
  # Maximum number of times a password/secret can be reused for enrollment
  # (default: -1, which means there is no limit)
  maxenrollments: -1

  # Contains identity information which is used when LDAP is disabled
  identities:
     - name: Admin
       pass: adminpw
       type: client
       affiliation: 
       attrs:
          hf.Registrar.Roles: "*"
          hf.Registrar.DelegateRoles: "*"
          hf.Revoker: true
          hf.IntermediateCA: true
          hf.GenCRL: true
          hf.Registrar.Attributes: "*"
          hf.AffiliationMgr: true

affiliations:
   org1:
      - department1
      - department2
   org2:
      - department1

signing:
    default:
      usage:
        - digital signature
      expiry: 8760h
    profiles:
      ca:
         usage:
           - cert sign
           - crl sign
         expiry: 43800h
         caconstraint:
           isca: true
           maxpathlen: 5
      tls:
         usage:
            - signing
            - key encipherment
            - server auth
            - client auth
            - key agreement
         expiry: 8760h

csr:
   cn: fabric-ca-server
   names:
      - C: US
        ST: "California"
        L:
        O: Hyperledger
        OU: Fabric
   hosts:
     - ca
     - localhost
   ca:
      expiry: 131400h
      pathlength: 5

我发现根本原因很简单,因为在初始化网络时,我不会自己创建证书/密钥并对其进行配置,以便结构可以使用其自身的密钥/证书,配置默认设置maxpathlen=1。

如果我自己在cert config pathlength>3中创建证书/密钥,那么我的网络将正常。

那么您是否正在尝试注册“中间CA 3”?如果您可以发布您正在运行的命令和/或代码,这将非常有用。我怀疑您正在尝试使用fabric CA客户端实际注册“中间CA 3”?在这种情况下,您需要确保您通过了
--enrollment.profile“ca”
标志我可以注册中间ca 3的管理员用户,但在此之后,我无法在“中间ca 3”中注册新身份,它总是抛出上面的错误你能发布你的
fabric ca config.yaml
文件或至少是ca profiles部分吗?我在问题中更新了配置文件,谢谢:)