Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coinbase API client.getAccount(...) started returning: "Error: unable to get local issuer certificate" [duplicate]

The issue started late-morning PT, on March 31, 2020. The server making the API call to Coinbase is hosted on Google App Engine with node.js (GCP). The same cert-connectivity problem to Coinbase also happened a few weeks ago, and lasted for about a day. The cert-connectivity problem went away all by itself at that time. No code changes were made to the server calling the Coinbase API then, or today. The same code has been working for over a year, but was moved to App engine a few months ago. - Has Coinbase been making network changes that would impact cert-authentication to Google Cloud Platform?

like image 295
red eye Avatar asked Mar 31 '20 22:03

red eye


1 Answers

Coinbase they updated their certificates . Fix: when you initiate the client you can either set strictSSL to false or pass in the new valid certificates.

Set strictSSL to false:

var Client = require('coinbase').Client;
var client = new Client({
   apiKey: mykey, 
   apiSecret: mysecret,
   strictSSL: false
});

update cert files (you should be able to export them here - https://baltimore-cybertrust-root.chain-demos.digicert.com/ or try coinbase.com and export there):

var Client = require('coinbase').Client;
var client = new Client({
   apiKey: mykey, 
   apiSecret: mysecret,
   caFile: myNewCertFile
});

myNewCertFiles should follow this files format with the updated certs: https://github.com/coinbase/coinbase-node/blob/master/lib/CoinbaseCertStore.js

like image 165
Leninkumar Avatar answered Nov 13 '22 14:11

Leninkumar