Re: Error wrong tag

kkulis
Regular Visitor

Error wrong tag

HI,

i'm getting and error while trying to get  https://sandbox.api.visa.com/forexrates/v2/foreignexchangerates

I'm using a .pfx file.

Without SSL it works but with SSL I get error as below:

 

 

 

error Error: wrong tag
    at configSecureContext (node:internal/tls/secure-context:287:15)
    at Object.createSecureContext (node:_tls_common:116:3)
    at Object.connect (node:_tls_wrap:1763:48)
    at Agent.createConnection (node:https:171:22)
    at Agent.createSocket (node:_http_agent:340:26)
    at Agent.addRequest (node:_http_agent:288:10)
    at new ClientRequest (node:_http_client:334:16)
    at Object.request (node:https:379:10)
    at RedirectableRequest._performRequest (/app/node_modules/follow-redirects/index.js:326:24)

 

 

What does this mean?

Thanks 

 

4 REPLIES 4
jenn_kh
Community Moderator

Re: Error wrong tag

Hi @kkulis, Thank you for reaching out. An agent will look into this and get back to you as soon as possible. In the meantime, if any community member knows a solution, please feel free to reply.

kkulis
Regular Visitor

Re: Error wrong tag

After investigation I noticed that the certificate on localhost (windows) is passed this way:

'sandbox.api.visa.com:443:::::::0�\x0E\x7F\x02\x01\x030�\x0E5\x06\t*�H��\r\x01\x07\x01��\x0E&\x04�\x0E"0�\x0E\x1E0�\b�\x06\t*�H��\r\x01\x07\x06��\b�0�\b\x7F\x02\x01\x000�\bx\x06\t*�H��\r\x01\x07\x010W\x06\t*�H��\r\x01\x05\r0J0)\x06\t*�H��\r\x01\x05\f0\x1C\x04\bʡ�?`B�e\x02\x02\b\x000\f\x06\b*�H��\r\x02\t\x05\x000\x1D\x06\t`�H\x01e\x03\x04\x01*\x04\x10�\x17I����z�>?\x0F�K�ƀ�\b\x10\x07�

but on production server (linux) this way

 'sandbox.api.visa.com:443:::::::-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCALxjfj6csJ6ba\n/qHR5uiLkPn9MqNFoCjJs6Wrjt1QHz/Sz26w4N9UPqHbYXK9KDymcubsuvLwO1a7\nUUcniH4aQGp85fYakL322W1SuOzNbWM7ZUPBVjBpA2ALrpOPxbC7jSg6+Ou4j1fy\nVCQAl8+NW9GmXe3xFNTRHMgn3R9Gi0hNNj5nuTnbRK0V8ckYRNyft4Er

 

I wonder if this could be the reason and how to fix it

kkulis
Regular Visitor

Re: Error wrong tag

The problem was with Azure. After using the @azure package to get the certificates, the problem disappeared

jenn_kh
Community Moderator

Re: Error wrong tag

Thank you for updating the community with your solution!