hyperledger / hyperledger/fabric-chaincode-java

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

未关闭
#220 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
help wanted
主要语言
Java
星标
323
派生
210
平均合并
8 小时 1 分钟
30 天内合并 PR
8

描述

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).

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。