processone / processone/ejabberd

Cannot use critical constraints in the server certificate.

Open
#3,659 1 comment 2 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.