Require peer cert for server mode in TLS transport#363
Open
padelsbach wants to merge 1 commit into
Open
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #363
Scan targets checked: wolfhsm-core-bugs, wolfhsm-src
No new issues found in the changed files. ✅
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the POSIX TLS transport’s server-side peer verification behavior so that when peer verification is enabled, the server requires the client to present a certificate (mTLS), aligning the transport behavior with “require peer cert” expectations.
Changes:
- Extends
LoadTlsCertificates()with anis_serverflag to differentiate client vs server verification behavior. - In server mode (and when peer verification is not disabled), sets
WOLFSSL_VERIFY_PEER | WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERTto require a client certificate. - Updates TLS client/server initialization paths to pass the new
is_serverflag.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+107
to
+111
| else if (is_server) { | ||
| wolfSSL_CTX_set_verify(ssl_ctx, | ||
| WOLFSSL_VERIFY_PEER | | ||
| WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT, | ||
| NULL); |
Comment on lines
63
to
+65
| static int LoadTlsCertificates(WOLFSSL_CTX* ssl_ctx, | ||
| const posixTransportTlsConfig* cfg) | ||
| const posixTransportTlsConfig* cfg, | ||
| int is_server) |
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.
Fixes F-3809