hyperledger / hyperledger/fabric-chaincode-java

Incorrect parsing of SSL certificates and keys in ChaincodeBase in external launcher case

Ouverte
#220 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
help wanted
Langage dominant
Java
Étoiles
323
Forks
210
Merge moyen
8 h 1 min
PR mergées (30 j)
8

Description

ChaincodeBase attempts to parse SSL certificates and keys provided by an external launcher in the following manner:

```
final SslContext createSSLContext() throws IOException {
final byte[] ckb = Files.readAllBytes(Paths.get(this.tlsClientKeyPath));
final byte[] ccb = Files.readAllBytes(Paths.get(this.tlsClientCertPath));

return GrpcSslContexts.forClient().trustManager(new File(this.tlsClientRootCertPath))
.keyManager(new ByteArrayInputStream(Base64.getDecoder().decode(ccb)),
new ByteArrayInputStream(Base64.getDecoder().decode(ckb)))
.build();
}
```

This fails, because the certs deployed by the external builder are in PEM format, but the code attempts to Base64 decode them.

The fix is obvious, and I have used it successfully in testing (however, I would have to jump through a bunch of hoops to contribute it, so someone else should probably do it).

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.