I am trying to test JAMS and Jami in order to have a private network, and try to understand in depth this solution.
I have installed JAMS in a Debian VM in a public cloudwith default JDK (17), behind a reverse proxy (caddy, that do letsencrypt natively). I have coturn installed on the same host. openDHT will later be installed, I keep jami.net DHT nodes at this time. I have completed the setup with a local database, created a blueprint, then a group, and a few users for testing.
The JAMS works great at this point.
When a client comes to connect to JAMS, it seems to connect (green dot on the account), but a few seconds after I got an arange dot, and a warning: “Aucune connexion au réseau n’est possible”
When a client (Windows desktop or android) come to login to my JAMS instance, I see the device calling https:///api/auth/device, with a positive response with certificate, and configuration for the client. Sounds good.
Then, the client calls https:///api/login with a strangly empty JSON payload : “{}”. JAMS respond with a HTTP 401 with {“error”:“Invalid credentials provided!”}.
Have you ever seem that behaviour ? How could I track it down to fix it ?
Did you try to connect to JAMS without your reverse proxy ? If it works without the reverse proxy it means that the JAMS server itself works fine.
We never tested caddy as a reverse proxy for JAMS. We recommend using NGINX as a reverse proxy.
When we set up JAMS behind an NGINX reverse proxy that manages Let’s Encrypt, we must add these options to the NGINX configuration AFTER the initial setup of JAMS:
Thanks for your reply.
Yes, I have tryed without the reverse proxy (direct connect to 8080, without HTTPS).
As far as I can see, I do not feel this is proxy issue. Caddy is really self managing the letsencrypt, and yes, the CA.pem (CA used for generating devices certs) was added after JAMS setup.
Just to note, here is my Caddy config file, if someone wish to use it :
This is quite equivalent to to the proposed nginx config. Caddy generate and manage the letsencrypt certificates on its own without additions.
Since the client/server perform the call to /api/auth/device with what seem to be a valid response with certificates and configuration, I guess I have met more a client side issue, than a proxy issue or some bad configuration.
are these SSL certificates mandatory ? From the code in jami-jams\jams-server\src\main\java\net\jami\jams\server\core\TomcatLauncher.java, and the documentation (Jams Documentation | Jami Store), I guessed no. Am I wrong ?
I then copied the certificate, and private key from /etc/letsencrypt/live/… to jams installation folder to make it available to the application. JAMS is started with the cert and key :
And the reverse proxy is removed: JAMS is directly exposed to internet on HTTPS.
When accessing JAMS from the web browser, it works fine, the HTTPS certificate is fully valid.
Now, when a client connect, I have a SSL issue (logs from Jami client side Jami.exe -d):
[1738316116.886|8116] [http:request:8] connect begin: X.X.X.X:443
[1738316116.888|8116] adding 63 decoded certs to X509 store
[1738316116.890|8116] [connection:8] start https session with system CA
[1738316116.938|8116] [connection:8] verify myjams.domain.com compliance to RFC 2818:
/CN=myjams.domain.com
[1738316116.939|8116] [http::connection:8] ssl verification error=20 false
[1738316116.941|8116] [connection:8] verify handshake error: 20
[1738316116.942|8116] [http:request:8] handshake error: certificate verify failed (SSL routines, tls_process_server_certificate)
[1738316116.942|8116] [http:request:8] end with error: Une requ�te d�envoi ou de r�ception de donn�es n�a pas �t� autoris�e car le socket n�est pas connect� et (lors de l�envoi sur un socket datagramme en utilisant un appel sendto) aucune adresse n�a �t� fournie.
Even if letsencrypt is a well known certificate and registered in my Windows certificate store, it seems that Jami do not find the CA.
Would the CA have to be added in a specific store? or is there a trick on the JAMS cert.pem that should contain the fullchain in a specific order ?
Also, regarding the documentation : https://docs.jami.net/en_US/jams/admin.html#jams-and-nginx
Since JAMS require the HTTPS certificates, how to setup a reverse proxy in front of JAMS ?
The nginx conf example is calling JAMS on HTTP, not HTTPS.