Using MAMP Pro for local development I need to communicate with an external API. I need to specify a path to a certificate file and private key for a secure SSL connection. I got both of these files from the external party to set these up. Using Curl this is gonna be something like;
$ curl
--request POST
--url https://externalapitocall
--cert '/path/to/cert.crt'
--key '/path/to/key.key'
--user 'DEXNLxxxx:***********'
--header 'grant_type: client_credentials&scope=api'
--header 'content-type: application/x-www-form-urlencoded'
So basically I only need these certificates and key when calling this external API. (So not my normal SSL certificate) I'm at a loss how to implement this using best practices. Where do I need to store the .crt and .key file, and what should my path to these files be?
Looking back at this. Answered in: https://stackoverflow.com/a/25573495/4329627
It does not matter where it is stored. But the public part can be accessible for anyone. The private key part is what you need to put in a safe spot somewhere only your application /db can read the values. There is no specific file destination, at least not that I know of. Just make sure it is safely stored.