# Homey Script fetch gives error

**URL:** <https://community.homey.app/t/homey-script-fetch-gives-error/67067>\
**Category:** Questions & Help\
**Created:** [August 8, 2022, 11:25am UTC](https://community.homey.app/t/homey-script-fetch-gives-error/67067 "2022-08-08T11:25:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [August 8, 2022, 11:25am UTC](https://community.homey.app/t/homey-script-fetch-gives-error/67067/1 "2022-08-08T11:25:55Z")

</div>

I am trying to get some data for sunrise and sunset, but get an error, someone an idea what is going wrong? When i copy paste the url into a browser it does respond.

 ![Schermafbeelding 2022-08-08 om 13.21.32](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/a/6afa0de47af072a4a79bce3377b351ef560471cd.png)

This is the response i get when i copy paste it in a browser

 ![Schermafbeelding 2022-08-08 om 13.27.12](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/8/f8281c835211da12c3a993685a48bd23b8c935f6.png)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [August 8, 2022, 11:33am UTC](https://community.homey.app/t/homey-script-fetch-gives-error/67067/2 "2022-08-08T11:33:33Z")

</div>

> [@Marcel\_Ubels](#):
>
> This is the response i get when i copy paste it in a browser

“Niet beveiligd”.

The TLS/HTTPS certificate of the site has expired. The owner of the webserver should fix this.

Adding the following two lines to the top of your script will provide a (rather dirty) workaround:

```auto
const process = this.constructor.constructor('return process')();
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

```

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [August 8, 2022, 12:29pm UTC](https://community.homey.app/t/homey-script-fetch-gives-error/67067/3 "2022-08-08T12:29:51Z")

</div>

Thx it works now
