TLS握手失败,并显示远程错误:tls:证书服务器错误=订购者

Yeo*_*eou 1 hyperledger-fabric

我正在尝试在VM上手动设置超级账本结构。我已经生成了所有工件,并配置了orderer.yamlcore.yaml。我的订购者正在port上运行127.0.0.1:7050。当我尝试使用peer cli channel create命令创建频道时,我context deadline exceeded在对等终端上收到一条消息。

./bin/peer channel create -o 127.0.0.1:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls --cafile /home/fabric-release/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
Run Code Online (Sandbox Code Playgroud)

错误:创建交付客户端失败:订购者客户端无法连接到127.0.0.1:7050:创建新连接失败:超出了上下文截止日期

在订购者终端上,出现以下错误:

2019-04-23 09:22:03.707 EDT [core.comm] ServerHandshake-> ERRO 01b TLS握手失败,并显示错误远程错误:tls:错误的证书服务器=订购者remoteaddress = 127.0.0.1:38618

2019-04-23 09:22:04.699 EDT [core.comm] ServerHandshake-> ERRO 01c TLS握手失败,并显示错误远程错误:tls:错误的证书服务器=订购者remoteaddress = 127.0.0.1:38620

2019-04-23 09:22:06.187 EDT [core.comm] ServerHandshake-> ERRO 01d TLS握手失败,并显示错误远程错误:tls:错误的证书服务器=订购者remoteaddress = 127.0.0.1:38622

我已经进行了几次配置,不确定是否丢失了某些内容。以下是我的orderer.yaml

General:
  LedgerType: file
  ListenAddress: 127.0.0.1
  ListenPort: 7050

  TLS:
    Enabled: true
    PrivateKey: /home/fabric-release/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key
    Certificate: /home/fabric-release/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt
    RootCAs:
      - /home/fabric-release/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt
    ClientAuthRequired: true

  Keepalive:
    ServerMinInterval: 60s
    ServerInterval: 7200s
    ServerTimeout: 20s

  GenesisMethod: file

  GenesisProfile: OneOrgOrdererGenesis

  GenesisFile: channel-artifacts/genesis.block

  LocalMSPDIR: /home/fabric-release/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp

  LocalMSPID: OrdererMSP

  Authentication:
    TimeWindow: 15m

FileLedger:
  Location: /var/hyperledger/production/orderer
  Prefix: hyperledger-fabric-ordererledger
Run Code Online (Sandbox Code Playgroud)

Gar*_*ngh 5

问题是订购者使用的TLS服务器证书没有与“ 127.0.0.1”匹配的SAN。您可以在使用cryptogen生成工件时,通过使用自定义crypto-config.yaml向TLS证书添加“ localhost”和/或“ 127.0.0.1” :

# ---------------------------------------------------------------------------
# "OrdererOrgs" - Definition of organizations managing orderer nodes
# ---------------------------------------------------------------------------
OrdererOrgs:
  # ---------------------------------------------------------------------------
  # Orderer
  # ---------------------------------------------------------------------------
  - Name: Orderer
    Domain: example.com
    EnableNodeOUs: false

    # ---------------------------------------------------------------------------
    # "Specs" - See PeerOrgs below for complete description
    # ---------------------------------------------------------------------------
    Specs:
      - Hostname: orderer
        SANS:
          - "localhost"
          - "127.0.0.1"

# ---------------------------------------------------------------------------
# "PeerOrgs" - Definition of organizations managing peer nodes
# ---------------------------------------------------------------------------
PeerOrgs:
  # ---------------------------------------------------------------------------
  # Org1
  # ---------------------------------------------------------------------------
  - Name: org1
    Domain: org1.example.com
    EnableNodeOUs: true
    Template:
      Count: 2
      SANS:
         - "localhost"
         - "127.0.0.1"
    Users:
      Count: 1

  - Name: org2
    Domain: org2.example.com
    EnableNodeOUs: false
    Template:
      Count: 2
      SANS:
         - "localhost"
         - "127.0.0.1"
    Users:
      Count: 1
Run Code Online (Sandbox Code Playgroud)