Skip to content

ssl: Skip undecodable certificate_authorities names#11356

Open
ausimian wants to merge 1 commit into
erlang:maintfrom
ausimian:ssl/cert-auths-decode-error
Open

ssl: Skip undecodable certificate_authorities names#11356
ausimian wants to merge 1 commit into
erlang:maintfrom
ausimian:ssl/cert-auths-decode-error

Conversation

@ausimian

Copy link
Copy Markdown
Contributor

Summary

Fix TLS client handshakes failing when a server sends a TLS 1.2
CertificateRequest containing an undecodable CA name in the
certificate_authorities list.

The certificate_authorities list is advisory and is only used as a hint for
client certificate selection. Some real-world servers advertise CA names with
non-conformant encodings, such as countryName encoded as UTF8String. Previously,
one such entry caused public_key:pkix_normalize_name/1 to raise and abort the
whole handshake with a fatal decode_error.

This change skips only the malformed CA name and keeps any valid names.

Changes

Validation

  • git diff --check
  • make -C lib/ssl/src opt
  • make -C lib/ssl test ARGS="-suite ssl_handshake_SUITE -case drop_undecodable_certificate_authorities"
  • ./otp_build check --only-opt --no-docs --no-dialyzer --no-license-header --no-format-check --tests ssl

Fixes #11338

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

    2 files     66 suites   25m 32s ⏱️
  827 tests   781 ✅  46 💤 0 ❌
4 299 runs  3 338 ✅ 961 💤 0 ❌

Results for commit 352c8aa.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

The TLS CertificateRequest certificate_authorities list is only a hint for client certificate selection. Some real servers advertise CA names that violate PKIX type constraints, for example countryName encoded as UTF8String.

Previously ssl_handshake decoded every advertised CA name with public_key:pkix_normalize_name/1. One malformed advisory name could therefore abort the whole handshake with a fatal decode_error, even when the client had no certificate configured.

Catch normalization failures and drop only the bad CA name, keeping any valid names in the list. Add a regression test covering a malformed DN from erlangGH-11338 alongside a valid CA name.

Fixes erlang#11338
@ausimian ausimian force-pushed the ssl/cert-auths-decode-error branch from f5e091c to 352c8aa Compare July 12, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant