Syncthing API and https

I’m trying to build small app that would list status and some other info from syncthing api.

I tested api from terminal like this:

curl -H X-API-Key:nPOeddbrighXN-jcGwNrdoEtO6YUv56FR http://192.168.1.100:8080/rest/version

and it worked fine: {“arch”:“amd64”,“longVersion”:“syncthing v0.10.24 (go1.4.2 linux-amd64 default) unknown-user@syncthing-builder 2015-03-01 20:51:56 UTC”,“os”:“linux”,“version”:“v0.10.24”}

When i turned on https in gui same request gives: < a href=“https://192.168.1.101:8080/rest/version”>Found</ a>

When i change request to: curl -H X-API-Key:nPOeddbrighXN-jcGwNrdoEtO6YUv56FR https://192.168.1.100:8080/rest/version i get this error: curl: (35) error:04091077:rsa routines:INT_RSA_VERIFY:wrong signature length

As i never used any API before, i’m pretty much sure it’s just me being clueless how to get data trough https. And i know it’s probably not question for this forum, but i really have no idea where to ask, and i’m guessing i’m not only one trying this with syncthing so i’m asking here.

Hey Mario

You can use the “-k” parameter to allow insecure access to Syncthing https website

Example "curl -k -H X-API-Key:nPOeddbrighXN-jcGwNrdoEtO6YUv56FR https://192.168.1.100:8080/rest/version"

That’s weird. What you’re doing should work, and that error looks like a bug fixed in 2012… Do you get that error all the time, or only sometimes, or what?

@fpbard -k options works. Thanks!

@calmh It’s 100% of time.

-k should only be to accept the self signed certificate. I’m not sure why the wrong signature length error pops up nor why -k works around it… o_O