coap_openhitls.c: prefer SAN before CN for certificate names#2075
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the openHiTLS TLS backend to prefer certificate Subject Alternative Name (SAN) DNS entries over the Subject Common Name (CN) when deriving the peer “name” used for callback validation and SNI mismatch checks, aligning behavior with modern certificate validation expectations.
Changes:
- Add openHiTLS helper logic to extract DNS SAN first and fall back to CN when SAN is unavailable.
- Extend TLS backend test script with SAN-preferred and CN-fallback PKI test cases and certificate generation.
- Update the pinned openHiTLS commit reference used by CI.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/coap_openhitls.c |
Implements SAN-first name extraction (with CN fallback) for openHiTLS certificate name handling. |
examples/tls_backend_testcases.sh |
Adds PKI cert generation and test cases covering SAN preference and CN fallback. |
.github/workflows/main.yml |
Updates the pinned openHiTLS commit used during CI builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add prefer SAN before CN for certificate names