How to make api calls with .p12 certificate?

Options

I need to access a payments api that provides a .p12 certificate and requires it to be sent in calls.

Best Answer

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Answer ✓
    Options

    You can use mutual TLS (which is usually what is referenced here - the kind where you are providing a key like this to authenticate your request) in the lambda in Xano. Yo umake some code in the lambda It requires using the https and either fetch or axios libraries. You can do this in Xano - we've worked this before in State Change.

    Here's a snapshot of the code as I'm using it in a connection I have going today. The key is to initialize an Agent from https with your certificates, and then have the fetch library use the agent for its communication

    Obviously this isn't the easiest path: it's definitely part of the "hardest 5%" we work on at State Change in our office hours and forum.