I have a simple script that sends a GET request to my store’s ecom API. I have tried to make this call in R, Python and cURL and all 3 return a similar error:
Error in curl::curl_fetch_memory(url, handle = handle) :
SSL peer certificate or SSH remote key was not OK: [api.shoplightspeed.com] schannel: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.
My R code which returns the above error is as such:
library(httr)
library(jsonlite)
ecom_key<-'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
ecom_sec<-'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
url<-paste0('https://',ecom_key,':',ecom_sec,'@api.shoplightspeed.com/en/')
account<-GET(paste0(url,'account.json'))
I have tried updating my cURL and also found another post that suggested to try the openssl library but this did not help either and resulted in the same error.
It’s worth noting that the requests work perfectly fine in Postman, which leads me to believe there is something wrong with my machine in particular, but I want to exhaust all possible pain points.
Has anyone else faced a similar error? I have ran out of google search results.
CodingCrunch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.