How to attach Client Cert + Key to a request (MTLS)
Hello @mikeal,
I was wondering how I'm supposed to pass on key & cert when using bent in the context of MTLS.
From the developer docs for the https module, it is clear that you can in the option.
Best regards, Simon
hrm...
I try not to add any features that can’t be supported in the browser. But we should expose some kind of way to pass additional options to the underlying http client in each environment, just not sure what the best api for that will look like yet.
I get the argument and it sounds solid. But I see also a huge benefit/need to have such an option for nodejs. To make it a viable option.
If I'm remembering the interface correctly there is no other option that relies on an object. So you might add in an optional object. Which then can be merged with the other parameters prior to passing to http/https. What do you think?
Wouldn't this be solved by adding a request listener, a function passed to bent, that'll receive the raw connection / request for modification before executing the request?
This way bent can limit the support to what ever it chooses, and for inquiries like this the answer would simply be "use the request listener and check node docs how to do it".
For us consumers it would clearly separate the bent / not bent territory, and it would also be simple to identify places where we have such custom code.
The ecosystem could also develop sharable functions, like bent-mtls that would simply provide a function provider that would do the low level magic.
Only question, that I don't know answer to, is if some of the low level config changes outlive one request, in which case there would need to be a clean phase after receiving the response. But as said, it is beyond my expertise.