-
Notifications
You must be signed in to change notification settings - Fork 405
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
enhancement request. Please make caliper-fabric adaptor support alternative identity to be used as the client TLS identity for mutualTLS enabled #1327
Comments
@aronaks Many thanks for the detailed issue, very helpful. I assume the identity you place into options.tlsInfo is a different identity to the one being used to submit transactions ? How are your identities created ? Were there any messages in the peer logs ? When you do mutualTLS do you have a TLS identity per org or per individual identity ? This would help in defining how we could extend the network configuration file to include information about a TLS identity. |
Initial investigation is that the build uses cryptogen for it's cert creation. This doesn't put any restrictions on the use of a certificate so allows a private_key/certificate identity to be used for TLS as well as an identity which is what the fabric connectors rely on when reusing an identity as a TLS identity for mutual connection. So while caliper does support mutual TLS, it's in a very limited capacility in that identities (ie their certificates in this case) must not restrict their use and also be allowed to be used for TLS comms. Caliper will need to be enhanced to allow for alternative identities to be supplied to be used as the client TLS identity and probably should support definition at both the Org Level as well as at an individual user level. However I think that support for a TLS identity at an individual user level is not a priority and could be user feedback driven. |
@davidkel thank you for the answer. In our case, the identity we place into options.tlsInfo is an identity for TLS auth. It is indeed a different identity to the one being used to submit transactions. The identity for submitting transactions is specified in the network configuration file of caliper ( In our organisation we have two CAs as it is described here. We created an identity per end user, and TLS identity per client (caliper in our case). There were errors like that below on the peer at some point, but I am not sure they are related to the case as we tried different combinations of config: |
What is required here is something like
we need to also be able to handle the wallet option as well (but that will almost certainly be a naming convention of which ones are tls client certs in the wallet (eg, identities endind with |
Which Caliper version are you using?
latest
Which Node.JS version are you using?
v14.19.0
Which operating system are you using?
macOs Monterey 12.3.1
Please provide some context for your error. For example, when did the error occur? What were you trying to achieve, and how?
I tried to generate load for hp-fabric blockchain SUT with
mutualTls
enabled. I tried different versions of caliper, namely 0.4.2, 0.5.0 and different versions of fabric adaptor, 1.4, latest-v2.It is written in the Caliper documentation that mutual TLS is supported. However, I did not find any way to provide Caliper with TLS user private key and certificate neither via network config file nor via connection profile. Maybe I missed something? Please help me to find that out.
What was the observed incorrect behavior?
The observed incorrect behaviour is that
caliper-fabric
adaptor tries to useinvokerIdentity
user's private key and certificate for the mutualTLS connection.You can see on the screenshot below that
aliasName
is assigned toclientTlsIdentity
, but thisaliasName
is taken from the network certificateorganizations.identities.certificates.name
and supposed to be used as ainvokerIdentity
.fabric-network/src/gateway.ts
So, to conclude, no matter which user and related clientPrivateKey and clientSignedCert I use in
organizations.identities.certificates.name
, it will end up with the error because that user cannot have two roles at the same time, be a TLS connection user and be an invokerIdentity user.Please provide the error logs and their surroundings.
Please provide your benchmark configuration file content, if possible.
Please provide your network configuration file content, if possible.
Please provide your workload module content, if possible.
Please provide any additional information you deem relevant to the error.
As a workaround I used the following code below and it works perfectly fine for mutualTLS in my case.
Because
clientTlsIdentity
is empty, another branch of the if loop will be selected in fabric-network, and TLS data will be taken from defined tlsInfo:fabric-network/src/gateway.ts
The text was updated successfully, but these errors were encountered: