Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is Fetch limited to https?

ANSWERED

I cannot get Fetch working with http://. Is it possible to use Fetch with http:// instead of https:// addresses?
Or get data from such a server in another way?

Best Answer
28 REPLIES 28

I successfully installed https but no success. My URL is something like https://ip/endpoint and I am still getting fetch error. Note that the code works when I send my data to firebase cloud database. Any good help?

Best Answer
0 Votes

Did you use a self-signed certificate or a certificate that traces to a top-level Certificate Authority?

I don't think the Fitbit app trusts self-signed certificates.

If your server is on localhost from the point of view of the Fitbit app (ie, same physical device), you may not need https since you may be able to use one of the allow-listed IPs. However, if your 'localhost' is actually a different device on your LAN, then you will.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

It is a self-signed certificate on my local machine. With http alone, it did not work. After reading many threads on different forums and after checking fetch documentations, I decided to go with https but it is not solving the issue. Here is my situation, I build and deploy Fitbit app in the real device and I want the heart rate data captured by the device to be sent to another PC running nodejs as its backend on POST method. On another PC, it is where I configured https using self signed certificate. But it is not solving my issue still. The only option I have now is to use firebase cloud and then retrieve this data from firebase but I really wanted data to be sent directly from device to another server without firebase in the loop.

Best Answer
0 Votes

Self-signed won't cut it. If you don't want to use a CA-trusted cert (eg, what firebase has), you can use http to localhost (which will be the device on which the Fitbit app is running), and forward the data from there to your LAN IP. Either way, you need to use an intermediate server to receive the data from the Fitbit app. You can choose between firebase or localhost. If you choose the latter, you'll need to write and install a server on the Fitbit app device.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thank you very much. localhost you mean an app that will run on the Fitbit watch or Android device? I want to get the data from real device.

Best Answer
0 Votes

To use http, it needs to be localhost from the point of view of the Fitbit app, which probably means your Android phone/tablet.

Have a search for my stuff here; I've developed a few Android-based intermediate servers. I've used Java, Python and node.js. In the latter case, you need a node.js environment on your Android. I used dorynode, but it's a bit worrisome.

At risk of contradicting my earlier posts, you MAY be able to authorise your self-signed cert by installing and trusting it on your Android via Android Settings. I could never get that to work. If you try and win, I'd be interested to know!

Peter McLennan
Gondwana Software
Best Answer
0 Votes

I can try that late since my priority at the moment is to get the data. I will try to write an Android app to use localhost, from Android I can use Websocket to transfer this to another server. Do you have any docoment or sample code to use fetch and send this data to Android app or it is same as the one I used for firebase?

 

Moderator Edit: Formatting.

Best Answer
0 Votes

Should be same as your firebase code, with server address adjusted. There are some examples in the previous link.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thanks. Let me try it and I will let you know.

Best Answer
0 Votes