I have question about Certificate. those api need two way ssl to authenticate

khan333
Newbie

I have question about Certificate. those api need two way ssl to authenticate

I have question about Certificate. those api need two way ssl to authenticate 

2 REPLIES 2
jenn_kh
Community Moderator

Re: I have question about Certificate. those api need two way ssl to authenticate

Hi khan333, Thank you for reaching out. An agent will get back to you as soon. Until then, if any community member has information that may be helpful, please feel free to reply.

DianaVisaPM
Visa Developer Support Specialist

Re: I have question about Certificate. those api need two way ssl to authenticate

Hey @khan333

 

To use Visa APIs that require two-way SSL (mutual SSL) for authentication, you need to follow a specific process to obtain and configure the necessary certificates. Here are the steps you can follow:

1. Generate a Key Pair and CSR (Certificate Signing Request):
- You need to create a key pair (public and private keys) and a CSR. The private key should be kept secure and not shared with anyone. The CSR will be used to request a certificate from Visa.

2. Submit the CSR to Visa:
- Once you have your CSR, you can submit it to Visa through the Visa Developer Portal. Visa will use this CSR to generate an SSL certificate for you.

3. Download the Visa-Signed Certificate:
- After Visa processes your CSR, you can download the Visa-signed certificate from the Visa Developer Portal.

4. Configure Your Application:
- Configure your application to use the Visa-signed certificate along with your private key for mutual SSL authentication. This typically involves setting up your HTTP client to use the certificate and private key when making API requests to Visa.

 

Here's an example of the steps to generate a key pair and CSR using OpenSSL:

```bash
# START 

# Generate a private key
openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048

# Generate a CSR using the private key
openssl req -new -key private_key.pem -out csr.pem

# END 
```

 

After generating the CSR, you will submit it to Visa via the Visa Developer Portal. Once you receive the Visa-signed certificate, you can configure your application. Here is an example of how you might configure an HTTP client in Python using the `requests` library:

```python
# START 

import requests

# Paths to your private key and Visa-signed certificate
private_key_path = 'path/to/private_key.pem'
certificate_path = 'path/to/visa_signed_certificate.pem'

# API endpoint you want to access
url = 'https://sandbox.api.visa.com/vdp/helloworld'

# Making a request with mutual SSL authentication
response = requests.get(url, cert=(certificate_path, private_key_path))

print(response.status_code)
print(response.json())

# END 
```

 

For more detailed instructions and guidance, you can refer to the Two-Way SSL (Mutual Authentication) Guide on the Visa Developer Portal. This guide provides comprehensive information on generating keys, submitting CSRs, and configuring your environment for mutual SSL authentication.




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.