4

First, I know this a duplicate question from this link but the asker seems to not answer anymore... but i still have the problem and need help!

So, When I use the command composer install I face this error:

⠙ Installing business network. This may take a minute...E0426 10:56:40.033781775 24341 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

Here is the connection.json file that i am using:

{
"name": "hlfv1",
"x-type": "hlfv1",
"x-commitTimeout": 300,
"version": "1.0.0",
"client": {
    "organization": "Org1",
    "connection": {
        "timeout": {
            "peer": {
                "endorser": "300",
                "eventHub": "300",
                "eventReg": "300"
            },
            "orderer": "300"
        }
    }
},
"channels": {
    "composerchannel": {
        "orderers": [
            "orderer.example.com"
        ],
        "peers": {
            "peer0.org1.example.com": {
                "endorsingPeer": true,
                "chaincodeQuery": true,
                "eventSource": true
            }
        }
    }
},
"organizations": {
    "Org1": {
        "mspid": "Org1MSP",
        "peers": [
            "peer0.org1.example.com"
        ],
        "certificateAuthorities": [
            "ca.org1.example.com"
        ]
    }
},
"orderers": {
    "orderer.example.com": {
        "url": "grpcs://<My_IP>:7050",
        "grpcOptions": {
            "ssl-target-name-override": "orderer.example.com"
        },
        "tlsCACerts": {
            "pem": "INSERT_ORDERER_CA_CERT"
        }
    }
},
"peers": {
    "peer0.org1.example.com": {
        "url": "grpcs://<My_IP>:7051",
        "eventUrl": "grpcs://<My_IP>:7053",
        "grpcOptions": {
            "ssl-target-name-override": "peer0.org1.example.com"
        },
        "tlsCACerts": {
            "pem": "INSERT_ORG1_CA_CERT"
        }
    }
},
"certificateAuthorities": {
    "ca.org1.example.com": {
        "url": "https://<My_IP>:7054",
        "caName": "ca.org1.example.com",
        "httpOptions": {
            "verify": false
        }
    }
}
}

And this is the docker-compose.yaml file which i am using:

version: '2'
services:
  ca.org1.example.com:
    image: hyperledger/fabric-ca:$ARCH-1.1.0
    environment:
      - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
      - FABRIC_CA_SERVER_CA_NAME=ca.org1.example.com
    ports:
      - "7054:7054"
    command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/CA1_PRIVATE_KEY -b admin:adminpw -d'
    volumes:
      - ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
    container_name: ca.org1.example.com
  orderer.example.com:
    container_name: orderer.example.com
    image: hyperledger/fabric-orderer:$ARCH-1.1.0
    environment:
      - ORDERER_GENERAL_LOGLEVEL=debug
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_GENESISMETHOD=file
      - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/composer-genesis.block
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer/msp
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    ports:
      - 7050:7050
    volumes:
        - ./:/etc/hyperledger/configtx
        - ./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/etc/hyperledger/msp/orderer/msp
  peer0.org1.example.com:
    container_name: peer0.org1.example.com
    image: hyperledger/fabric-peer:$ARCH-1.1.0
    environment:
      - CORE_LOGGING_LEVEL=debug
      - CORE_CHAINCODE_LOGGING_LEVEL=DEBUG
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_PEER_ID=peer0.org1.example.com
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=composer_default
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/peer/msp
      - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
      - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5984
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: peer node start
    ports:
      - 7051:7051
      - 7052:7052
      - 7053:7053
    volumes:
        - /var/run/:/host/var/run/
        - ./:/etc/hyperledger/configtx
        - ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/peer/msp
        - ./crypto-config/peerOrganizations/org1.example.com/users:/etc/hyperledger/msp/users
        - ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/peer/tls
    depends_on:
      - orderer.example.com
      - couchdb
  couchdb:
    container_name: couchdb
    image: hyperledger/fabric-couchdb:$ARCH-0.4.6
    ports:
      - 5984:5984
    environment:
      DB_URL: http://localhost:5984/member_db

I don't know what to do and I really need help.

Thanks

Pouya Shojaei
  • 307
  • 1
  • 10
Cocorico
  • 1,998
  • 1
  • 22
  • 38
  • In your connection.json I see you have which I guess in your file you really have IP addresses - but have you also replaced the "INSERT_ORG1_CA_CERT" etc with your pem certs, in 1 long string with \n characters included? Also if you look at your container logs (prob CA and Orderer) you will see more detail of the error. – R Thatcher Apr 26 '18 at 09:39
  • Yes, I replaced the "INSERT_ORG1_CA_CERT" like this `perl -p -i -e 's@INSERT_ORG1_CA_CERT@$ENV{ORG1_CA_CERT}@g' tmp/connectionOrg2.json` – Cocorico Apr 26 '18 at 09:44
  • And I can't find error in the docker logs of CA, Orderer or Peer0.... – Cocorico Apr 26 '18 at 09:53
  • Are you generating the certs new beforehand? That was a problem for me. – Simon Mullaney Apr 26 '18 at 19:19
  • Well, I just copy the connectionProfile.json from fabric-tools>fabric-scripts>hlfv11 in the createPeerAdminCard.sh and use it. In this one, there is `"tlsCACerts": { "pem": "INSERT_ORG1_CA_CERT" }` for peers, and it worked :) – Cocorico Apr 27 '18 at 07:37
  • looks like you do not have TLS enabled on any of your Fabric or Fabric CA nodes. Can you try changing "grpcs" to "grpc" and "https" to "http" in your connection profile? – Gari Singh Apr 27 '18 at 11:50
  • any solution in 2019? @Cocorico – sharif2008 Sep 30 '19 at 14:37

1 Answers1

0

if you have disabled TLS in fabric setup then change all occurrence of grpcs to grpc and https to http. it should work. i also have the same error and this worked for me.

Ravi
  • 1