taskwarrior-flutter icon indicating copy to clipboard operation
taskwarrior-flutter copied to clipboard

taskd sync error: Error: Handshake failed. The TLS connection was non-properly terminated.

Open sanjayankur31 opened this issue 2 years ago • 5 comments

Hello,

Thanks for writing this up. Looks great.

I've been trying to set up sync here. All the settings seem fine, they all say "verified", but when I try to sync, nothing happens. The "syncing" pop up comes and quickly goes.

On my taskserver, I see only these messages:

Error: Handshake failed. The TLS connection was non-properly terminated.

There are a number of issues on the taskserver repo related to this, but without any debugging on the app, it's hard to say if it's one of these.

Any ideas on how to debug this?

Also, has this been tested with all taskserver versions? I'm using task version 2.6.2, and taskserver 1.1.0 and they work fine without any issues.

sanjayankur31 avatar Nov 24 '23 22:11 sanjayankur31

What have you entered as server certificate? Refering from your taskserver config, it should be the file entered for server.cert (not the ca.cert)

blaisegarant avatar Jan 21 '24 20:01 blaisegarant

I'm running into the same problem, and I was using ca.cert but switched to server.cert and am still running into the same problem. Let me know if there's any details I can provide that would be helpful, I've had no issue syncing with taskwarrior from the cli client, and my server has been operational for years at this point.

I notice as well, I only get one of logs: Apr 04 17:05:28 box taskd[2320527]: 2024-04-05 00:05:28 Error: Handshake failed. The TLS connection was non-properly terminated. no matter how many times I hit sync / get stats.

Chickensoupwithrice avatar Apr 05 '24 00:04 Chickensoupwithrice

Basically, your certificates have two sources and are referenced in two configs.

  1. Your https server (source)
  2. Your taskd server (source & config)
  3. Your client (config)

For your https server, I personnaly use letsencrypt, once I setup my main certificate (because I have a few of them), the certificate I'll mention were created. If you use another server, your experience might vary. For the one from taskd, if you follow the instructions from the doc, you'll have everything you need.

For the configuration, I'll assume your certificates sourced from your https server are in /https and your taskd's in /pki. It is better if your taskd server has a direct access to your https certificates, otherwise you`ll have to copy them should they changes.

In taskd: server.cert = /https/fullchain.pem server.key = /https/privkey.pem server.crl = /pki/server.crl.pem ca.cert = pki/ca.cert.pem client.cert = pki/client.cert.pem client.key = pki/client.key.pem

In your client (of course, those are copies) taskd.certificate=/pki/user_name.cert.pem taskd.key=/pki/user_name.key.pem taskd.ca=/pki/ca.cert.pem

last point for your config is taskd.credential. In your taskd configuration directory, users are stored in the sort: org/<organization>/users/<user_id> with your <user_name> in the org/<organization>/users/<user_id>/config file. Therefore, taskd=/<user_name>/<user_id>

blaisegarant avatar Apr 15 '24 19:04 blaisegarant

I'm running http server on my local network, so there's no HTTPS. Perhaps that may be an issue? I followed certificate generation for setting up taskd from the docs.

I've set all these configuration options as you stated and it still returns the same error :/

Chickensoupwithrice avatar May 03 '24 19:05 Chickensoupwithrice

I am experiencing the same thing. I am assuming the handshaking is failing because I have a letsencrypt certificate on my DNS and I use a separate self-signed certificated on taskd. I have been using this setup for years and it has been working fine on the CLI.

Aerex avatar May 05 '24 22:05 Aerex