Unable to configure request config for httpsAgent
See original GitHub issueHi guys,
I have difficulties on configuring apisauce specific for httpsAgent. What i want to achieve is, i want to the client to check certificate of secure service i accessing, more popular term is certificate pinning. Axios itself have support for this as explained here.
So here is what i try to do :
var https = require(https);
// unable to load https module since it is built-in Node module
const api = apisauce.create({
baseURL,
headers: {
'Cache-Control': 'no-cache',
Accept: 'application/json',
'Content-Type': 'application/json'
},
httpsAgent: new https.Agent({
//public CER
ca: 'cer-file.cer'
}),
timeout: 10000
});
I notice the problem is when i call https module which are built in node module.
var https = require(https);
Is there other way to configure this to able to run in react-native apps?
There is node.js http module substitution for react-native, but i couln’t find one for https.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to configure axios to use SSL certificate? - Stack Overflow
It should be noted that I am using axios to make the request. I attach my agent configuration in axios. const httpsAgent =...
Read more >axios error unable to verify the first certificate - You.com
You do that by configuring the https agent in axios - have a look at this answer for an example : How to...
Read more >HTTPS Authorized Certs with Node.js - Circle Engineering
Let's alter the server by setting requestCert and rejectUnauthorized to true in the options and adding a bit to the console.log line. var...
Read more >Unable to get any response from the apple pay
I am integrating the apple pay and following the payment request api! ... I have fulfilled server setup and environment setup requirements with...
Read more >Axios Cheat Sheet - Kapeli - Dash for macOS
Request Config ; : '/user ; // `baseURL` will be prepended to `url` unless `url` is absolute. // It can be convenient to...
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 FreeTop 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
Top GitHub Comments
Hi @SamiChab, i already tried
react-native-pinch
on my project and successfully implementing certificate pinning. Last time i work for this project is april last year, i couldn’t verify if this is still working or not today.What i do is replacing all
apisauce
REST API call implementation withreact-native-pinch
. Also additional work on parsingreact-native-pinch
response & error to becomeapisauce
compatible.I want get a npm package https, because i can’t download from the npm addr.so who can help me!thanks!