processone / processone/ejabberd
Cannot use critical constraints in the server certificate.
Nobody has claimed this yet.
- Dominant language
- Erlang
- Stars
- 6.7k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
Environment
- ejabberd version: 21.01-2
- Erlang version: Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 11.1.8
- OS: Linux (Debian 11)
- Installed from: distro package
Errors from error.log/crash.log
No errors
Bug description
Please, give us a precise description (what does not work, what is expected, etc.)
Attempting to use a certificate chain as a server certificate with a critical flag on the X509v3 Basic Constraints causes ejabberd to reject the chain with the following error in ejabberd.log:
[warning] <0.355.0>@ejabberd_pkix:log_warnings/1:393
Invalid certificate in /etc/ejabberd/ejabberd.pem: at line 43:
unknown_critical_extension
The only critical constraints in this certificate chain are:
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Basic Constraints: critical
CA:TRUE, pathlen:0
and
X509v3 Basic Constraints: critical
CA:TRUE
I cannot change these constraints as they are defined by the CA.
I would expect that the most basic of CA flag checks would be handled correctly by whatever TLS library is used.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the certificate validation warning from ejabberd_pkix:log_warnings/1 and reproduce it using the chain at /etc/ejabberd/ejabberd.pem. Check how the Erlang TLS or certificate-validation path handles critical X509v3 Basic Constraints. Done means a chain containing critical CA:FALSE, CA:TRUE, and pathlen:0 constraints is accepted when otherwise valid, without the unknown_critical_extension warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- erlang
- Domain
- backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100