S
Supabase5d ago
VINI

How to add mTLS in calling a oauth2.0 api in Edge Functions

I'm calling a api of a bank, which the api method is by oauth2.0 and a digital certificate TLS. How can I call that api by that certificate, I have added the .pfx certificate as base64 to the supabase secrets for after reading it and generating the token but It doesn't work. Someone can help me?
4 Replies
inder
inder5d ago
This guide is for nodejs but I think it will work with deno as well. Might need some changes https://sebtrif.xyz/blog/2019-10-03-client-side-ssl-in-node-js-with-fetch/ This article has examples to set up custom fetch client with deno https://medium.com/deno-the-complete-reference/custom-http-client-with-fetch-in-deno-890055d397ba
VINI
VINIOP5d ago
ok, I'll take a look but does it makes sense to store the digital certificate in base64 in supabase secrets? I was using Deno.createHttpClient()
inder
inder5d ago
Ya the first link is mainly for nodejs. The second one uses deno.createHttpClient I use base64 encoded ssl certs in github actions all the time.
VINI
VINIOP5d ago
ok, i'll check the second link I helped me a lot, thank you very much It worked

Did you find this page helpful?