# TypeError: Network request failed on HTTPS

**URL:** <https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872>\
**Category:** How-to Discussions\
**Created:** [October 2, 2016, 1:46pm UTC](https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872 "2016-10-02T13:46:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donald](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Donald](https://forums.fusetools.com/u/Donald)\
**Post date:** [October 2, 2016, 1:46pm UTC](https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872/1 "2016-10-02T13:46:12Z")

</div>

Hi

i’m doing request with fetch to HTTPS server, which has selfsigned certificate:

```ruby
 fetch('https://198.206.134.30/test_post', {
            method: 'POST',
            headers: {
                 "Authorization": "Basic dGVzdHVzZXI6dGVzdHBhc3M=",
                 "content-type": "application/x-www-form-urlencoded"
            },
            body: "username=q&passwd=q"
        }).then(function(response) {
            return response.json();            
        }).then(function(responseObject) {
            console.log('responseObject);
        }).catch(function (err) {
            console.log("err: " + err);
        });

```

```ruby
 fetch('https://198.206.134.30/test_get', {
            method: 'GET',
            headers: {
                 "Authorization": "Basic dGVzdHVzZXI6dGVzdHBhc3M="
            }
        }).then(function(response) {
            return response.json();            
        }).then(function(responseObject) {
            console.log('responseObject);
        }).catch(function (err) {
            console.log("err: " + err);
        });

```

> Always i get error: TypeError: Network request failed

\*\* It works correctly over curl: \*\*

`req: curl -X GET -H "Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=" "https://198.206.134.30/test_get" -k`

`res: TEST SSL GET - OK`

`req: curl -X POST -H "Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=" -H "Content-Type: application/x-www-form-urlencoded" -d 'username=q&passwd=q' "https://198.206.134.30/test_post" -k`

`res: TEST SSL POST - OK`

\*\* but only with parameter -k, --insecure Allow connections to SSL sites without certs \*\*

Any ideas, how is possible do request on HTTPS server with selfsigned certificate, also with some parameter for doing connect without certs, like do it curl ?

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [October 4, 2016, 4:30pm UTC](https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872/2 "2016-10-04T16:30:31Z")

</div>

Hi,

I’m not sure about the details of your specific issue, but I can see that we have several HTTPS-related issues on file already and this will be worked on over the next few weeks.

Is this working in other `fetch` based environments ? (e.g. Node.js)

---

<div class="post-metadata">

**Author:** ![Donald](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Donald](https://forums.fusetools.com/u/Donald)\
**Post date:** [October 4, 2016, 6:06pm UTC](https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872/3 "2016-10-04T18:06:26Z")

</div>

Primary issue is, that fetch has problem with selfsigned certificate. When i do HTTPS request on site with signed certificate by CA, then fetch works correctly.

---

<div class="post-metadata">

**Author:** ![terje](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/terje/32/564_2.png) [@terje](https://forums.fusetools.com/u/terje)\
**Post date:** [May 10, 2017, 6:39pm UTC](https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872/4 "2017-05-10T18:39:12Z")

</div>

Any progress on this problem ?  
[https://data.smartbydata.no/api/3/action/package\_search?fq=tags:Kart](https://data.smartbydata.no/api/3/action/package_search?fq=tags:Kart)  
It does not work in the simulator. But it works on the android device.

---

<div class="post-metadata">

**Author:** ![Anders\_Bondehagen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_bondehagen/32/98_2.png) [@Anders\_Bondehagen](https://forums.fusetools.com/u/Anders_Bondehagen)\
**Post date:** [May 10, 2017, 7:13pm UTC](https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872/5 "2017-05-10T19:13:48Z")

</div>

I guess you are talking about preview on mac and not on the actual simulated devices you have in xcode right? If that is the case, we have not fixed this yet. But we are working on rewriting http on that target.

---

<div class="post-metadata">

**Author:** ![Vicker\_Leung](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/vicker_leung/32/392_2.png) [@Vicker\_Leung](https://forums.fusetools.com/u/Vicker_Leung)\
**Post date:** [November 21, 2017, 6:34am UTC](https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872/6 "2017-11-21T06:34:52Z")

</div>

Just wanna check if there are any update or workaround with this issue.

---

<div class="post-metadata">

**Author:** ![Anders\_Bondehagen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_bondehagen/32/98_2.png) [@Anders\_Bondehagen](https://forums.fusetools.com/u/Anders_Bondehagen)\
**Post date:** [November 21, 2017, 8:46am UTC](https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872/7 "2017-11-21T08:46:49Z")

</div>

There is no other workaround other than using the ios simulator for preview on Mac. The new implementation is currently in testing internally but I’m not sure in what release it will roll out.

---

<div class="post-metadata">

**Author:** ![Vicker\_Leung](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/vicker_leung/32/392_2.png) [@Vicker\_Leung](https://forums.fusetools.com/u/Vicker_Leung)\
**Post date:** [November 21, 2017, 9:52am UTC](https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872/8 "2017-11-21T09:52:21Z")

</div>

Great to know, Anders. Looking forward to the upcoming update. Thanks.

---

<div class="post-metadata">

**Author:** ![forza](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@forza](https://forums.fusetools.com/u/forza)\
**Post date:** [September 26, 2019, 12:57pm UTC](https://forums.fusetools.com/t/typeerror-network-request-failed-on-https/5872/9 "2019-09-26T12:57:33Z")

</div>

Hello every one,

i’m having the same error like @Donald: “TypeError: Network request failed” while using Android simulator and i don’ t have Mac. Any update about this issue?

Thanks in avance
