Closed manoelpqueiroz closed 7 months ago
Have you tried setting the server to rpi.local:53589
? It looks like it's unable to resolve the hostname rpi
.
I confess I haven't tried because the documentation explicitly informs that the CN
variable inside the vars
file must match hostname -f
. If that is indeed the case, I would have to change my machine's hostname to rpi.local
, which in turn would require a SSH command to be ssh myuser@rpi.local.local
, and so forth and so on.
What I have tried more recently:
CN
variable to rpi.local
;pki
folder;$TASKDDATA
;taskdctl restart
;clientuser
in defaultgroup
;clientuser
inside the pki
folder;clientuser.*.pem
and ca.cert.pem
to home-laptop
;taskd.credentials
with the new UUID for clientuser
.However, I still get an error:
$ task sync init
Please confirm that you wish to upload all your tasks to the Taskserver (yes/no) y
Syncing with rpi.local:53589
Could not connect to rpi.local 53589
Sync failed. Could not connect to the Taskserver.
This error is raised almost immediately after the command is run on the CLI. In contrast, when I had the previous Name or service not known
, it took a few seconds between running the command and receiving the error, which leads me to believe the client is able to at least find the server, but unable to resolve its name.
Hm, that's a different error at least. Can you connect to that host and port with something like curl
?
@djmitche, sorry for the late reply. I have made some additional tests since I last tested (still no success in setting taskserver up).
Using curl
:
curl rpi.local:53589
curl: (52) Empty reply from server
Using wget
seems to indicate the connection is at least successful (however note the first attempt in which the connection is refused through IPv6:
wget -S -t 3 rpi.local:53589
--2024-01-27 11:42:00-- http://rpi.local:53589/
Resolving rpi.local (rpi.local)... 2004:14c:1a9:870e:e75b:1ff:fed9:cac0, 192.160.0.5
Connecting to rpi.local (rpi.local)|2004:14c:1a9:870e:e75b:1ff:fed9:cac0|:53589... failed: Connection refused.
Connecting to rpi.local (rpi.local)|192.160.0.5|:53589... connected.
HTTP request sent, awaiting response... No data received.
Retrying.
--2024-01-27 11:42:01-- (try: 2) http://rpi.local:53589/
Connecting to rpi.local (rpi.local)|192.160.0.5|:53589... connected.
HTTP request sent, awaiting response... No data received.
Retrying.
--2024-01-27 11:42:03-- (try: 3) http://rpi.local:53589/
Connecting to rpi.local (rpi.local)|192.160.0.5|:53589... connected.
HTTP request sent, awaiting response... No data received.
Giving up.
openssl s_client -CAfile ~/.task/ca.cert.pem -host rpi.local -port 53589
returns Verify return code: 0
;certtool -i < server.cert.pem | grep Subject:
returns a non-empty string outputting the CN and O variables;certtool -i --infile ~/.task/clientuser.cert.pem
Checking the process ID and port:
sudo lsof -i TCP:53589 -s TCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
taskd 750 taskd-user 3u IPv4 20882 0t0 TCP rpi:53589 (LISTEN)
netstat -tl | grep 53589
tcp 0 0 rpi:53589 0.0.0.0:* LISTEN
Checking connectivity from the client:
Starting Nmap 7.94 ( https://nmap.org ) at 2024-01-27 12:24 -03
Nmap scan report for rpi.local (192.160.0.5)
Host is up (0.10s latency).
Other addresses for rpi.local (not scanned): 2004:14c:1a9:870e:e75b:1ff:fed9:cac0
Nmap done: 1 IP address (1 host up) scanned in 0.13 seconds
Starting Nmap 7.94 ( https://nmap.org ) at 2024-01-27 12:25 -03
Nmap scan report for rpi.local (192.160.0.5)
Host is up (0.011s latency).
Other addresses for rpi.local (not scanned): 2004:14c:1a9:870e:e75b:1ff:fed9:cac0
PORT STATE SERVICE
53589/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.45 seconds
Syncing in debug mode on the client:
task rc.debug=1 rc.debug.tls=2 sync init
Please confirm that you wish to upload all your tasks to the Taskserver (yes/no) y
c: INFO Server certificate will be verified.
c: 2 Initializing needed PKCS #11 modules
c: 2 p11: Initializing module: p11-kit-trust
c: 2 p11: No login requested.
c: 2 p11: No login requested.
c: 2 added 6 protocols, 29 ciphersuites, 19 sig algos and 10 groups into priority list
c: 2 Keeping ciphersuite 13.02 (GNUTLS_AES_256_GCM_SHA384)
c: 2 Keeping ciphersuite 13.03 (GNUTLS_CHACHA20_POLY1305_SHA256)
c: 2 Keeping ciphersuite 13.01 (GNUTLS_AES_128_GCM_SHA256)
c: 2 Keeping ciphersuite 13.04 (GNUTLS_AES_128_CCM_SHA256)
c: 2 Keeping ciphersuite c0.2c (GNUTLS_ECDHE_ECDSA_AES_256_GCM_SHA384)
c: 2 Keeping ciphersuite cc.a9 (GNUTLS_ECDHE_ECDSA_CHACHA20_POLY1305)
c: 2 Keeping ciphersuite c0.ad (GNUTLS_ECDHE_ECDSA_AES_256_CCM)
c: 2 Keeping ciphersuite c0.0a (GNUTLS_ECDHE_ECDSA_AES_256_CBC_SHA1)
c: 2 Keeping ciphersuite c0.2b (GNUTLS_ECDHE_ECDSA_AES_128_GCM_SHA256)
c: 2 Keeping ciphersuite c0.ac (GNUTLS_ECDHE_ECDSA_AES_128_CCM)
c: 2 Keeping ciphersuite c0.09 (GNUTLS_ECDHE_ECDSA_AES_128_CBC_SHA1)
c: 2 Keeping ciphersuite c0.30 (GNUTLS_ECDHE_RSA_AES_256_GCM_SHA384)
c: 2 Keeping ciphersuite cc.a8 (GNUTLS_ECDHE_RSA_CHACHA20_POLY1305)
c: 2 Keeping ciphersuite c0.14 (GNUTLS_ECDHE_RSA_AES_256_CBC_SHA1)
c: 2 Keeping ciphersuite c0.2f (GNUTLS_ECDHE_RSA_AES_128_GCM_SHA256)
c: 2 Keeping ciphersuite c0.13 (GNUTLS_ECDHE_RSA_AES_128_CBC_SHA1)
c: 2 Keeping ciphersuite 00.9d (GNUTLS_RSA_AES_256_GCM_SHA384)
c: 2 Keeping ciphersuite c0.9d (GNUTLS_RSA_AES_256_CCM)
c: 2 Keeping ciphersuite 00.35 (GNUTLS_RSA_AES_256_CBC_SHA1)
c: 2 Keeping ciphersuite 00.9c (GNUTLS_RSA_AES_128_GCM_SHA256)
c: 2 Keeping ciphersuite c0.9c (GNUTLS_RSA_AES_128_CCM)
c: 2 Keeping ciphersuite 00.2f (GNUTLS_RSA_AES_128_CBC_SHA1)
c: 2 Keeping ciphersuite 00.9f (GNUTLS_DHE_RSA_AES_256_GCM_SHA384)
c: 2 Keeping ciphersuite cc.aa (GNUTLS_DHE_RSA_CHACHA20_POLY1305)
c: 2 Keeping ciphersuite c0.9f (GNUTLS_DHE_RSA_AES_256_CCM)
c: 2 Keeping ciphersuite 00.39 (GNUTLS_DHE_RSA_AES_256_CBC_SHA1)
c: 2 Keeping ciphersuite 00.9e (GNUTLS_DHE_RSA_AES_128_GCM_SHA256)
c: 2 Keeping ciphersuite c0.9e (GNUTLS_DHE_RSA_AES_128_CCM)
c: 2 Keeping ciphersuite 00.33 (GNUTLS_DHE_RSA_AES_128_CBC_SHA1)
c: 2 Advertizing version 3.4
c: 2 Advertizing version 3.3
c: 2 Advertizing version 3.2
c: 2 Advertizing version 3.1
c: 2 HSK[0x57cecf38ea80]: sent server name: 'rpi.local'
c: 2 EXT[0x57cecf38ea80]: client generated SECP256R1 shared key
Timer Config::load (/home/myuser/.taskrc) 0.000556 sec
Parse Tree (before command-specifіc processing)
_original_args
task rc.debug=1 rc.debug.tls=2 sync init
_args
word basename='task' raw='task' BINARY
pair modifier='debug' name='rc' raw='rc.debug=1' separator='=' value='1' CONFIG ORIGINAL
pair modifier='debug.tls' name='rc' raw='rc.debug.tls=2' separator='=' value='2' CONFIG ORIGINAL
identifier canonical='synchronize' raw='sync' ORIGINAL CMD ALLOWSMISC
identifier raw='init' ORIGINAL MISCELLANEOUS
pending.data rw - T0529+000~000-000 L0529+000
completed.data rw - T0479+000~000-000 L0479+000
undo.data rw - T0000+000~000-000 L0000+000
backlog.data rw - T0000+000~000-000 L0000+000
Perf task 2.6.2 - 20240127T155503Z init:1856 load:17324 gc:0 filter:0 commit:297 sort:0 render:0 hooks:1 other:1803273 total:1805427
Syncing with rpi.local:53589
Configuration override rc.debug=1
Configuration override rc.debug.tls=2
Handshake failed. The certificate is NOT trusted. The name in the certificate does not match the expected.
Sync failed. Could not connect to the Taskserver.
It looks that after all the .local
part, which is needed to SSH into the server, is what makes it impossible to conciliate between my server's hostname (rpi
) and the CN
variable.
Is it possible to reopen this issue for us to assess this?
Sure
"The name in the certificate does not match the expected" suggests that the name in the certificate does not match the expected name (c: 2 HSK[0x57cecf38ea80]: sent server name: 'rpi.local'
). But you said in an earlier comment that you changed the name in the certificate to be rpi.local
-- so that doesn't quite add up. When you ran the openssl s_client
command, what CN did you see? For example with github.com
I see
subject=C = US, ST = California, L = San Francisco, O = "GitHub, Inc.", CN = github.com
What happens if you add -verify
and -verify_hostname
to that command?
Closing since taskserver is no longer supported.
Hi everyone,
I have set up a Taskserver on a Raspberry Pi 4, but now I am unable to make it sync over the local network. I have tried searching for the term
raspberry
andlocal network
, but there are very few cases of issues and none seem to pertain to mine.Also, I have tried looking for a logging document to better provide you with context, but haven't found it for the Taskwarrior client. I am certain it's a very simple configuration I am missing, but haven't been able to get from the documentation, would really appreciate your help with this one.
Context
I have a Raspberry Pi 4 in which I have successfully set up Taskserver. Its hostname is
rpi
and so is the output of thehostname
command.Now, I have a client set up in another local machine (hostname
home-laptop
) which can currently accessrpi
via SSH, for instance, but after generating the certificates, copying them to my client and asking to sync, it raises a failure message:Diagnostics
taskd diag
on the server::warning: One thing I find strange is that it shows certificate and key as missing, but inside
/var/taskd
, they are present with the respective group:task diag
on the client inhome-laptop
:To check if this is a problem during connection or during the configuration of my Taskserver, I have created a second user called
test-1
and set up a Taskwarrior client inrpi
itself. In this case, syncing is working fine as it should be expected, so something is preventing the connection betweenrpi
andhome-laptop
.task diag
on the client onrpi
:As a final document, here is what is registered in the log:
Additional Context
I'm certain the problem is with my hostname somehow, but I'm not sure how to go about it. One thing that might be relevant is that I am using this Raspberry Pi with
cloud-init
, so when I want to SSH into it, I use the.local
domain:$ ssh myuser@rpi.local
What could I be doing wrong here? Any hints? I apologise beforehand for reaching out through here, but I exhausted the references available in documentation and forums like Stack Exchange. I really appreciate your help.