question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTP load failed, 0/0 bytes in iOS

See original GitHub issue

Hi,

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 import {fetch as certFetch} from 'react-native-ssl-pinning'; could be the problem? → We tested with import {fetch} from 'react-native-ssl-pinning'; the problem still remains.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MaxToybermancommented, Jul 18, 2020

@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

0reactions
MaxToybermancommented, Jul 18, 2020

@Alph4Four this solution will not work properly, I will fix this issue as part of the library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP load failed (error code: | Apple Developer Forums
Hi,. I am working on an application , where it getting urls in response for Images to load from that urls. I am...
Read more >
ios - NSURLSession "HTTP load failed ...
I have a similar setup, and solved this issue by adding my self-signed root CA to the iPad trusted certificates. This root CA...
Read more >
HTTP load failed, 0/0 bytes (error code: -1003 [10:-72000])
问题描述: OS X应用无法访问网络请求,超时后报错:HTTP load failed, 0/0 bytes (error code: -1003 [10:-72000]). 原因: 沙盒配置错误.
Read more >
Unable to connect in macOS or iOS from Xcode - Remoting SDK
<0> HTTP load failed, 0/0 bytes (error code: 1 [1:1]) > 2019-12-24 15:01:55.103438-0800 AppServerTestMac[5619:551606] NSURLConnection finished with error ...
Read more >
HTTPS API calls fail using iOS 13 SDK (HTTP load failed)
This is the error in Xcode log -. Task <FC61C756-9EA6-451C-B0A6-BD99BDD65CEB>.<1> HTTP load failed, 11705/0 bytes (error code: 303 [4:-2205]).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found