0

I am trying to connect to the Visa Direct API, but i am not passing the basic SSL certificate authetification, here is my code:

import requests             
headers = { 'Content-Type' : 'Application/json' }
url = 'https://sandbox.visa.com/rsrv_vpp/v1/acnl'

 payload = {"SystemsTraceAuditNumber":565690,
"RetrievalReferenceNumber":"505012455690",
"AcquiringBin":409999,
"AcquirerCountryCode":"840",
"PrimaryAccountNumber":"4895070000008881"}

r = requests.post(url, data=json.dumps(payload), 
 cert =('/etc/ssl/certs/sandbox_cert.pem'), headers=headers,
 auth=('370df57a-a8aa-4446-a23e-44a0ef06ea09',
 '6023e518-c36c-47a8-b16e-c8a5b3a941ef'))

Ass you can see i am using request and passing the cert argument along with the API user and password info but i keep getting the error:

requests.exceptions.SSLError: [Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

1 Answer 1

1

I get a SSL error when I try to open https://sandbox.visa.com/rsrv_vpp/v1/acnl in Google Chrome.

The Visa Docs say

  1. SSL Server Authentication

The SSL server certificate installed on sandbox.visa.com servers is a Visa issued self-signed certificate. Client applications need to add the sandbox.visa.com SSL certificate to their local trust store to prevent SSL Handshake errors at runtime.

Ensure that your application that connects to the Visa Direct API is configured (or built) to use the trusted certificate store as a trust store, and not a key store.

Verify that the application is configured to use the right password associated with the trust store file.

It looks like you need to do do some SSL Authentication before you can connect to Visa.

Sign up to request clarification or add additional context in comments.

2 Comments

do you have any source for this? the API says you need to present a pkcs12 certificate to their server to pass SSL auth im not sure how to do that in python
Unfortunately I don't know anything more about SSL authentication. I have no idea what a pkcs12 certificate is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.