Skip to content
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

How to attach Client Cert + Key to a request (MTLS) #122

Open
Templum opened this issue Oct 12, 2020 · 3 comments
Open

How to attach Client Cert + Key to a request (MTLS) #122

Templum opened this issue Oct 12, 2020 · 3 comments

Comments

@Templum
Copy link

Templum commented Oct 12, 2020

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

@mikeal
Copy link
Owner

mikeal commented Oct 12, 2020

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.

@Templum
Copy link
Author

Templum commented Oct 13, 2020

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?

@swftvsn
Copy link

swftvsn commented Nov 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants