Sample Code for Two-Way (Mutual) SSL With NodeJS

YonatanHanan
Regular Visitor

Sample Code for Two-Way (Mutual) SSL With NodeJS

Hi, 

 

I have a problem getting started with the "Sample Code for Two-Way (Mutual) SSL" using the nodejs example.

I copied the code from this page https://developer.visa.com/pages/working-with-visa-apis/two-way-ssl .

 

for the "keyFile" i put the path of my private key.

for the "certificateFile" i put the path of  my Project Certificate.

for the "caFile" i put the path of  my Visa Development Platform Certificate.

 

and i get this error:

Error: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch
    at Object.createSecureContext (_tls_common.js:105:17)
    at Object.exports.connect (_tls_wrap.js:1048:48)
    at Agent.createConnection (https.js:111:22)
    at Agent.createSocket (_http_agent.js:217:26)
    at Agent.addRequest (_http_agent.js:187:10)
    at new ClientRequest (_http_client.js:272:16)
    at Object.request (http.js:39:10)
    at Object.request (https.js:239:15)
    at Request.start (C:\Users\Yonatan\Projects\Visa\visa_transaction_controls\customer_rules_api\node_modules\request\request.js:751:32)
    at Request.end (C:\Users\Yonatan\Projects\Visa\visa_transaction_controls\customer_rules_api\node_modules\request\request.js:1511:10)

 

1 REPLY 1
jvenkata
Community Moderator

Re: Sample Code for Two-Way (Mutual) SSL With NodeJS

Hello,

 

Please see below.

 

1. Key file is the private key which you have downloaded when you have created the project

2. cert is the cert.pem file which is your project certificate

3. ca is the Digicert Root CA which you download from the Common Certificate link on Credentials tab. Please make sure you download it from the link provided there and it has an extension of .cer and not .crt.

 

Please try again after you make above changes.

 

Thanks,

 

Jai