Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to get client TLS config: Error parsing certificate: x509: malformed serial number #1181

Open
adnerwin00 opened this issue Feb 26, 2024 · 0 comments

Comments

@adnerwin00
Copy link

I've set up a network using fabric-sample version 2.4.7. While there's an option to back up and restore, I'm currently working on renewing expired certificates, including the CA server's, which is valid until 2038.

147 directories, 202 files

The Docker setup I've been working with is as follows:

CONTAINER ID   IMAGE                               COMMAND                  CREATED         STATUS                      PORTS                                                                                                NAMES
1f7a14254111   hyperledger/fabric-tools:latest     "/bin/bash"              12 months ago   Exited (137) 4 weeks ago                                                                                                         cli
d038bacb111   hyperledger/fabric-peer:latest      "peer node start"        12 months ago   Exited (1) 46 seconds ago                                                                                                        peer0.org1.example.com
8549a1564111d   hyperledger/fabric-peer:latest      "peer node start"        12 months ago   Exited (0) 4 weeks ago                                                                                                           peer0.org2.example.com
a1edccd9111   couchdb:3.1.1                       "tini -- /docker-ent…"   12 months ago   Exited (0) 4 weeks ago                                                                                                           couchdb0
8f565236111c   hyperledger/fabric-orderer:latest   "orderer"                12 months ago   Exited (0) 4 weeks ago                                                                                                           orderer.example.com
aec0812a1112   couchdb:3.1.1                       "tini -- /docker-ent…"   12 months ago   Exited (0) 4 weeks ago                                                                                                           couchdb1
fcb349a5111c   hyperledger/fabric-ca:latest        "sh -c 'fabric-ca-se…"   12 months ago   Up 34 minutes               0.0.0.0:9054->9054/tcp, :::9054->9054/tcp, 7054/tcp, 0.0.0.0:19054->19054/tcp, :::19054->19054/tcp   ca_orderer
75b8c8f282e4   hyperledger/fabric-ca:latest        "sh -c 'fabric-ca-se…"   12 months ago   Exited (2) 4 weeks ago                                                                                                           ca_org1
b21071ec7f7b   hyperledger/fabric-ca:latest        "sh -c 'fabric-ca-se…"   12 months ago   Exited (2) 4 weeks ago

When I try to run peer0.org1.example.com, peer0.org2.example.com, and orderer.example.com, the certificates are expired, so they won't run.

2024-02-22 09:57:48.515 UTC 0001 ERRO [main] InitCmd -> Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp: signing identity expired 319h35m48.515285305s ago
How can we renew the certificates in fabric-sample to utilize existing data? I'd like to hear multiple opinions.

In the fabric-ca-client-config.yaml file located at fabric-samples/test-network/organizations/ordererOrganizations/example.com directory, I've modified the following section:

tls:
  # TLS section for secure socket connection
  certfiles: ../../fabric-ca/ordererOrg/ca-cert.pem
  client:
    certfile: users/Admin@example.com/msp/cacerts/localhost-9054-ca-orderer.pem
    keyfile: users/Admin@example.com/msp/keystore/0a961a320b1ed03d4f2359e5360dd8f0b8ccb9f8d0c92f8a74479c6694253bd5_sk

The certificate at fabric-ca/ordererOrg/ca-cert.pem is valid until 2038, as confirmed by the command.

When I execute the command:
fabric-ca-client enroll -u https://admin:adminpw@localhost:9054 -M msp --tls.certfiles ../../fabric-ca/ordererOrg/ca-cert.pem --enrollment.profile tls --id.name admin --id.secret adminpw

I encounter the following error: the following error occurs:
Error: Failed to get client TLS config: Error parsing certificate: x509: malformed serial number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant