Adding a domain to Prosody

I have searched the forum for similar issues

on

This category is for issues regarding specific apps, NOT general issues with YunoHost.

on

This form is written in English but feel free to write in French if you’re more comfortable!

on

What app is this about, and its version

Prosody 0.12.4~ynh121

What YunoHost version are you running

12.1.41.2

What type of hardware are you using

Other(?)

Describe your issue

I have added a domain to my server, as in primary domain, not subdomain, and I want Prosody to serve both the main domain and the new one.

Both domains have a LetsEncrypt’s certificate, and I can access my yuno from domain1.tld and domain2.tld with no warning, emails are working for both domains (replicated on each, actually, very nice!).

For Prosody, I replicated the conf files in nginx:
domain1.tld.conf.d/prosody.conf
domain2.tld.conf.d/prosody.conf
updating the content with a simple search and replace for all occurrences of the domain name domain1.tld to domain2.tld/g

I did the same thing for Prosody, copying
/etc/prosody/conf.avail/domain1.tld.conf.lua
/etc/prosody/conf.avail/domain2.tld.conf.lua
again search and replace domain1.tld.conf.lua to domain2.tld.conf.lua, except for the turn server.

I have the DNS entries for SRV, muc, pubsub, http-upload

I reloaded nginx and restarted Prosody.
I can connect to Prosody with username@domain2.tld
BUT
Certificate error emitted to
domain1.tld
muc.domain1.tld
pubsub.domain1.tld
http-upload.domain1.tld

and I can’t figure where it points to these certificates and not the domain2.tld!

Anyone would have an idea??

Share relevant logs or error messages

Certificat
Nom du compte : username@domain2.tld
Adresse du compte : username@domain2.tld
Émis pour
Nom commun (CN) : domain1.tld
Organisation (O) : -
Noms alternatifs du sujet : domain1.tld
muc.domain1.tld
pubsub.domain1.tld
xmpp-upload.domain1.tld
Numéro de série : 06:D4:4A:85:49:9E:52:5D:1B
5F:D8:0F:B6:94:39:C4:5C:20

Émis par
Nom commun (CN) : YR1
Organisation (O) : Let’s Encrypt
Validité
Émis le : jeu 23 jui 2026 05:27:00 UTC
Expire le : mer 21 oct 2026 05:26:59 UTC

SHA-1 :
D9:68:BD:88:69:DF:B7:6E:E2:E7
12:C7:46:6B:E8:BF:11:58:3C:9E
SHA-256 :
27:32:83:59:DA:12:29:38
B8:95:D5:FC:10:8F:41:6A
97:D0:20:12:FB:3F:87:C2
7D:C0:59:8A:81:71:01:87

Clef publique : RSA 4096 Bit

I don’t think the prosody app currently supports multi domain, but you’ll probably have better answers from the app’s maintainers: prosody_ynh/manifest.toml at stable · YunoHost-Apps/prosody_ynh · GitHub

(personally i installed prosody manually without the package, but that has other problems)

FOUND IT!

Configuration file /etc/prosody/prosody.cfg.lua does have

c2s_direct_tls_ssl {
  key = "/etc/yunohost/certs/domain1.tld/key.pem";
  certificate = "/etc/yunohost/certs/domain1.tld/crt.pem";
}
s2s_direct_tls_ssl {
  key = "/etc/yunohost/certs/domain1.tld/key.pem";
  certificate = "/etc/yunohost/certs/domain1.tld/crt.pem";
}

I copied these in /etc/prosody/conf.avail/domain2.tld.cfg.lua in the VirtualHost block, adjusted the certificates paths, and… it works! I can connect, no alarm for certificates.

Remaining missing pieces: bosh and CORS don’t seem to work.