Unable to get local issuer certificate when fetching CSRF token
See original GitHub issueHello, I am trying to use the SAP Cloud SDK to create Purchase Requisitions. I am using the following code:
let builder = purchaseReqService
.PurchaseRequisitionHeader
.requestBuilder()
.create(payload)
.addCustomQueryParameters({'sap-client': 123})
return await builder
.execute({url: baseUrl});
When executing this code the request will fail when fetching the CSRF token:
Error: unable to get local issuer certificate
I can workaround this problem by using isTrustingAllCertificates. This is not what I want however. I had a similar issue in the past and was able to fix it by overwriting the CA certificates used by the http agent.
I saw that you are using axios as an underlying library and allow passing of custom request configurations to it. So I tried overwriting the httpsAgent.
let builder = purchaseReqService
.PurchaseRequisitionHeader
.requestBuilder()
.create(payload)
.addCustomQueryParameters({'sap-client': 123})
.addCustomRequestConfiguration({httpsAgent: new https.Agent({
ca: rootCAs,
})})
return await builder
.execute({url: baseUrl});
This did not help however and I still receive the error above. I cannot figure out how to proceed. Do you any idea?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:9 (6 by maintainers)
Top Results From Across the Web
npm install error - unable to get local issuer certificate
Open up dev tools and go to Security-> View Certificate. Check Certification path and make sure your at the top level certificate, if...
Read more >Solved: SSL Error: Unable to get local issuer certificate
Solved: I am using Postman to test the 2-ways SSL and it failed with "Error: unable to get local issuer certificate" What does...
Read more >unable to get local issuer certificate" error. What am I missing?
The error "Unable to get local issuer certificate" is caused by a misconfiguration of the SSL certificate on your machine. An SSL certificate...
Read more >Issues with CSRF token and how to solve them - SAP Blogs
4th issue – You are sending files to SAP Gateway using sap.ui.commons.FileUploader and you are getting 403 HTTP response – CSRF token validation ......
Read more >Need some assistance, started getting an error on our local ...
Created a new Connector running on https and we are getting certificate errors: Service error: Error: unable to get local issuer ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@artemkovalyov , FYI. I guess this is a rather quick win.
Hi @JulianGlattki ,
Thanks for your feedback. We will release a new minor version hopefully soon.