Hi I am connecting with VISA DIRECT for a project. In sandbox we have successfully made connectivity. Once in VCMS we are facing some challenge on connectivity. From postman we are getting success on connectivity. But once we are doing curl we are getting follwoing exception,
curl --cert cert.pem --key private.pem:Password --location --request GET "https://cert.api.visa.com/vdp/helloworld" -H "Authorization:Basic MDRWMEJGVDA5SzJJTU8yUThHTlkyMXdEYXVaY2NtemgySEUxZzJ4VThuRjBSTmUwTTpSOWRkR1J"
{"responseStatus":{"status":400,"code":"9123","severity":"ERROR","message":"Expected input credential was not present","info":""}}
From my codebase I have found that solution is working on windows but when I deploy it in linux based server somehow it is facing issue while reading client certificate file cert.pem on curl
Thank you for reaching out, @tanjimrahman! An agent is looking for a solution for you and will get back to you shortly. If any community members know a solution, please feel free to share it here.
-Jenn
Problem solved in a very uncommon way.
We have followed the exact same way as VDP documentation said for PHP.
curl_setopt($ch, CURLOPT_SSLCERT, $certificatePath); curl_setopt($ch, CURLOPT_SSLKEY, $privateKey);
This worked perfectly in sandbox. But in the certification environment, we found this block of code was not working in Linux but worked perfectly in any windows or ubuntu environment.
What we have to do is copy the private key to cert.pem file and use it only on curl certificate parameter,
curl_setopt($ch, CURLOPT_SSLCERT, $certificatePath);
Don't know the root cause yet but found it is working.