HTTP load failed, 0/0 bytes in iOS
See original GitHub issueHi,
I followed the entire procedure of installation and certificate importing described in the guide of the library.
Unfortunately, I am getting this error:
Task <CB3108BC-B528-4ADD-AB9D-2666CCE8AC19>.<1> HTTP load failed, 0/0 bytes (error code: -999 [1:89])
and then I get:
[warn][tid:com.facebook.react.JavaScript] Possible Unhandled Promise Rejection (id: 0): "cancelled"
I looked for the reason of this error, and I found that it could be related to a Metro Bundler caching failure. So, I cleaned and restarted Metro and cleaned (CMD+SHIFT+K) the Xcode project but this didn’t solved my problem.
At this point I have no idea on what to do.
Here is my example “test” button I used to test the library:
import {fetch as certFetch} from 'react-native-ssl-pinning';
...
<UserButton text={'Pinning test'} onPress={async () => {
console.log(`making certificate pinning test...`)
let userinfo = await db.get('userinfo')
let response = await certFetch('https://mysite.com/ext/authRequests?limit=1&page=1', {
method: "GET" ,
// your certificates array (needed only in android) ios will pick it automatically
sslPinning: {
certs: ["mycertname"] // your certificates name (without extension), for example cert1.cer, cert2.cer
},
headers: {
Accept: "application/json; charset=utf-8",
"Access-Control-Allow-Origin": "*",
"e_platform": "mobile",
}
})
console.log(`response: ${response}`)
}}/>
May the
→ We tested with import {fetch as certFetch} from 'react-native-ssl-pinning';
could be the problem?import {fetch} from 'react-native-ssl-pinning';
the problem still remains.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
@Alph4Four @dnsmob @strawberry-code versions 1.4.9 was released with the fix.
if you want to see the pr: https://github.com/MaxToyberman/react-native-ssl-pinning/pull/84
Please reopen if you have sill issues
@Alph4Four this solution will not work properly, I will fix this issue as part of the library.