TruBudget icon indicating copy to clipboard operation
TruBudget copied to clipboard

Fix bug in alpha connection with certificate

Open georgimld opened this issue 2 years ago • 2 comments

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Description 😯

The askAlphaForPermissions function in the blockchain has a bug. The rejectUnauthorized option should be set to 'true' in production.

georgimld avatar Oct 05 '22 08:10 georgimld

the rejectUnAuthorized option is for disabling client verification (mutual ssl). So if mutual ssl should be used this is true but not necessarily in production.

Stezido avatar Oct 05 '22 12:10 Stezido

The code of the https Agent is mixing up tls.connect options as you can see here, the key and cert options are relevant for client cert auth and the ca option is relevant for self-signed certificates. The https agent of the blockchain is looking like this: https://github.com/openkfw/TruBudget/blob/ad3c99a7f2f63f09e98428de8c08f50489ca8ed4/blockchain/src/connectToChain.js#L139-L151 TruBudget blockchain should support following options for the initial register node request:

  • En/Disable https
  • En/Disable verification of server certificate (rejectUnauthorized)
  • En/Disable mTLS (provide options cert & key)
  • En/Disable self signed server certificates (provide optiond ca)

I would suggest to provide a possibility to pass all https agent options via one env var or file to be as flexible as possible.

Stezido avatar Oct 05 '22 14:10 Stezido

This issue has been automatically marked as stale because it has not had activity for 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 04 '22 18:12 stale[bot]

This issue has been automatically closed because of inactivity. You can re-open it if needed.

stale[bot] avatar Dec 11 '22 19:12 stale[bot]