-
Hi, I'm running a bit insane on how to properly setup ejabberd's certificates in the official docker image to run some basic tests. In principle, I just want to launch ejabberd in Docker and connect two external (not from docker) clients to it, and do some basic tests sending messages from a custom Python app. So far I've launched the official docker image and passed the self signed certificates with: certfiles:
- "/opt/ejabberd/certs/*.pem in the openssl req -x509 -nodes -newkey rsa:4096 \
-keyout selfsigned.key \
-out selfsigned.crt -days 3650
cat selfsigned.key selfsigned.crt > selfsigned.pem and then renamed it to the expected files by ejabberd in the
I'm generating the self signed certificate in my machine and then copying them through a I'm using HOST as
What I don't understand:
So, to recap: self-signed certificate is considered invalid, then as if not exists at all and finally requesting certs through Can someone share step by step how to run ejabberd without any of these warnings popping up for a local testing environment? With what I've described above I've managed to connect ![]() I couldn't find any information online as how to do this: search engines giving me wrong/not relevant information and as far as I can tell this doesn't seem to be mentioned anywhere in the docs that I've been reading. What is it that I'm missing/not doing? I don't understand why is it hard to get an isolated testing environment up and running. Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
do recheck the folder&files permissions just in case |
Beta Was this translation helpful? Give feedback.
-
The public_key library in OTP says: For that reason, the pkix library returns an error when validating the path and reports that the certificate is self-signed. But notice that ejabberd itself shows that message as a warning, not an error. As ejabberd uses those certificates instead of rejecting them; it's important to show at least a warning in the log to alert the admin that the certificate is self-signed, just in case this is not a desired scenario.
It's mentioned in the documentation:
Anyway, that option is only needed because there are domains without any certificate. Once you successfully provide a cert for each domain (even if it is self-signed), then ACME will not trigger.
No idea what's wrong in your setup. I'll provide a full and detailed example to reproduce a valid scenario. To simplify the example, I'll create only a cert for the first domain. I use Podman and the Create the certificate and grant file permissions: host=mar1test.org
pem_file=$host.pem
openssl req -x509 \
-batch \
-nodes \
-newkey rsa:4096 \
-keyout $pem_file \
-out $pem_file \
-days 3650 \
-new \
-utf8 \
-nameopt lname,sep_multiline,utf8 \
-addext "subjectAltName = DNS:$host" \
-subj "/CN=$host" >'/dev/null' 2>&1 || :
openssl x509 -in $pem_file -noout -text | grep CN
podman unshare chown 9000:9000 mar1test.org.pem Prepare pod.yml file: apiVersion: v1
kind: Pod
metadata:
name: ejabberd
spec:
containers:
- name: ejabberd
image: ghcr.io/processone/ejabberd:latest
env:
- name: EJABBERD_MACRO_HOST
value: mar1test.org
- name: EJABBERD_MACRO_ADMIN
value: admin@mar1test.org
- name: REGISTER_ADMIN_PASSWORD
value: someP4ss
volumeMounts:
- mountPath: /opt/ejabberd/conf/server.pem
name: cert
volumes:
- name: cert
hostPath:
path: ./mar1test.org.pem
type: File Start the container: podman play kube pod.yml --replace --wait Now in another console, let's view the logs: podman pod logs --color --latest --follow --names
2025-08-29 08:50:04.386 [warning]
Invalid certificate in /opt/ejabberd/conf/server.pem:
at line 53: self-signed certificate
2025-08-29 08:50:04.411 [warning]
No certificate found matching pubsub.mar1test.org
2025-08-29 08:50:04.412 [warning]
No certificate found matching conference.mar1test.org
2025-08-29 08:50:04.412 [warning]
No certificate found matching upload.mar1test.org
2025-08-29 08:50:04.412 [warning]
No certificate found matching proxy.mar1test.org
2025-08-29 08:50:04.414 [info]
Requesting new certificate for pubsub.mar1test.org, conference.mar1test.org
and 2 more hosts from https://acme-v02.api.letsencrypt.org/directory As you can see, mar1test.org is no longer mentioned in the warnings, because we provided a valid certificate for it (even if it's self-signed and could be undesired, it is used and a warning is shown). Of course, now we should create certificates for the other domains, or add a wildcard. Also notice that ACME is only triggered for the four domains that we didn't provide a certificate (not even a self-signed one) |
Beta Was this translation helpful? Give feedback.
The public_key library in OTP says:
specific path validation errors, such as selfsigned_peer
For that reason, the pkix library returns an error when validating the path and reports that the certificate is self-signed.
But notice that ejabberd itself shows that message as a warning, not an error.
As ejabberd uses those certificates instead of rejecting them; it's important to show at least a warning in the log to alert the admin that the certificate is self-signed, just in case this is not a desired scenario.