Containerized Kopia server setup

Hello,
I have pretty much the exact same configuration running Kopia server in an LXC container (run by user kopia, on port 51515) proxied by HAProxy (which takes care of TLS for domain say kopia.domain.tld)
I can access the server Kopia UI from the browser (https://kopia.domain.tld) and manage the repository. However, I cannot access the server repository from command line running:

kopia repository connect server --url=https://kopia.domain.tld:443 --server-cert-fingerprint=<fingerprint> --password=<password>

This outputs the following error:

021-10-15 18:40:47.319294 I [logger.go:244] Connecting to server 'https://kopia.domain.tld:443' as '<$USER>@<hostname>...
2021-10-15 18:40:47.319494 D [logger.go:254] Creating cache directory '/home/<$USER>/.cache/kopia/1b0e0fd7e3249467' with max size 5242880000
2021-10-15 18:40:47.563462 D [logger.go:254] establishing new GRPC streaming session (purpose=)
2021-10-15 18:40:47.621536 D [logger.go:254] GRPC stream read loop terminated with rpc error: code = Unauthenticated desc = unexpected HTTP status code received from server: 401 (Unauthorized); transport: received unexpected content-type "text/plain; charset=utf-8"
2021-10-15 18:40:47.621863 E [logger.go:214] failed to open repository: unable to establish session for purpose=: error establishing session: unable to initialize session: rpc error: code = Unauthenticated desc = unexpected HTTP status code received from server: 401 (Unauthorized); transport: received unexpected content-type "text/plain; charset=utf-8": EOF

I have tried [to] --override-username and --override-hostname using other credentials created beforehand on the Kopia server using kopia server users add <username>, in vain.

Besides, the proxy log outputs the following 401 error:

Oct 15 20:29:39 hostname haproxy[25806]: ::ffff:<remote ip>:40326 [15/Oct/2021:20:29:39.410] main~ KOPIA/KOPIA 0/0/0/1/7 401 221 - - CD-- 2/2/0/0/0 0/0 "POST https://kopia.domain.tld:443/kopia_repository.KopiaRepository/Session HTTP/2.0"

Any hints?
Thanks a lot for your help.