Comments (5)
Happy to do so.
from fabric-sdk-java.
By changing the code in NetworkConfig.java to match the certFile and keyFile key names, it works. I have tested with my local fix.
if (keyfile != null) {
props.put("clientKeyFile", keyfile);
}
if (certfile != null) {
props.put("clientCertFile", certfile);
}
from fabric-sdk-java.
This looks like something that has never worked, and perhaps wasn't intended to. The change you refer to just introduced some new functionality and didn't change any existing property naming set by NetworkConfig. It seems by happy coincidence that it would provide the capability you are looking for too though.
The Endpoint code is picking up properties set either explicitly if nodes are programmatically added, or from configuration and/or environment variables when nodes are added by service discovery, here:
- Peer:
fabric-sdk-java/src/main/java/org/hyperledger/fabric/sdk/Channel.java
Lines 1696 to 1713 in 4d3cfc5
- Orderer:
fabric-sdk-java/src/main/java/org/hyperledger/fabric/sdk/Channel.java
Lines 1630 to 1649 in 4d3cfc5
Your suggested enhancement seems reasonable, although I think "tlsClientKeyFile", "tlsClientCertFile", "tlsClientKeyBytes" and "tlsClientCertBytes" would all need to change to the forms without the leading "tls" to match the Endpoint code. Note that these properties are also used in HFClient, here:
fabric-sdk-java/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java
Lines 1620 to 1630 in 4d3cfc5
I think the changes required would be:
- Change "tlsClient..." properties set in NetworkConfig to "client...".
- Change the corresponding property names in HFCAClient.
- Some unit testing (at least in NetworkConfigTest).
- Extract the strings hard-coded in all these locations to internal constants, probably in Endpoint
Would you like to implement these changes?
from fabric-sdk-java.
@bestbeforetoday I have made the changes, but it seems that I can't create a new pull request. Could you have a look?
https://github.com/irririki/fabric-sdk-java-260
- Change "tlsClient..." properties set in NetworkConfig to "client...".
- Change the corresponding property names in HFCAClient.
- Some unit testing (at least in NetworkConfigTest).
NetworkConfigTest and HFCAClientTest.java - Extract the strings hard-coded in all these locations to internal constants, probably in Endpoint
except in NetworkConfig and HFCAClient. I feel that it's better to pass the config around and define constants there, but that'd require some big changes.
[WARNING] Tests run: 444, Failures: 0, Errors: 0, Skipped: 5
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35.443 s
[INFO] Finished at: 2023-02-07T12:14:03+09:00
[INFO] ------------------------------------------------------------------------
from fabric-sdk-java.
I think the problem might be that your repository is not a fork if this repository. The repository with your changes needs to be a fork of the repository to which you want to propose changes by creating a pull request. See the GitHub documentation on how to fork a repo. Then the documentation on creating a pull request from a fork.
from fabric-sdk-java.
Related Issues (20)
- Getting block time exceeded 5 seconds for channel mychannel when peer join channel HOT 4
- New version release date with Log4j vulnerability managed HOT 1
- Jndi log4j vulnerability in fabric-sdk-java v2.1.1? HOT 1
- log4j2 issue HOT 1
- NetworkConfig.getPrivateKeyFromString read private key exception HOT 2
- Customization in the number of connections to hlf peer is unavailable and uses large number of threads HOT 2
- log4j update dependency HOT 2
- log4j Security Vulability CVE-2021-44832 Security Issue
- GeneratedMessageV3.isStringEmpty NoSuchMethodError issue HOT 3
- Separate logging of warnings and errors in channel.sendTransaction() method in low level java SDK
- Comment about `SERVICE_DISCOVERY` is incorrect and same with `EVENT_SOURCE`. HOT 1
- virtual machines entropy document links is broken
- Maven repository link is wrong
- Fabric read the docs: Chaincode for Operators is broken
- Cannot commit chaincode approve HOT 3
- Service Discovery bug on insufficient endorsements HOT 2
- fanric-java-sdk how to use Taking ledger snapshots and using them to join channels HOT 2
- Intermittent test failure: chaincode event ordering
- Vulnerable dependencies HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fabric-sdk-java.