-
Notifications
You must be signed in to change notification settings - Fork 5
Add TLS support for incoming MCP server connections #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dprince
wants to merge
1
commit into
openstack-lightspeed:main
Choose a base branch
from
dprince:tls
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+26
−1
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
In current Uvicorn docs, does settingssl_ca_certsalone enforce client certificate verification, or mustssl_cert_reqsalso be set (e.g.,ssl.CERT_REQUIRED)?💡 Result:
Setting
ssl_ca_certsalone does not enforce client certificate verification in current Uvicorn docs; you must also setssl_cert_reqs(e.g.,ssl.CERT_REQUIRED). Uvicorn’s settings documentation describes--ssl-cert-reqsas “Whether client certificate is required” and states the default isssl.CERT_NONE, i.e., no client cert requirement [1]. The same documentation lists--ssl-ca-certsas the CA certificates file, but it does not say that providing CA certs changes the “required/optional/none” behavior on its own [1]. The Uvicorn CLI options ultimately map to Python’s SSLContext verify mode;ssl_cert_reqscontrolsctx.verify_mode, whilessl_ca_certsis used to load trust roots for verification when verification is enabled [2]. Therefore, for mutual TLS enforcement (clients must present valid certificates), set bothssl_ca_certsandssl_cert_reqs=ssl.CERT_REQUIRED[1][2].Citations:
🏁 Script executed:
# Check the file exists and read the relevant section wc -l src/rhos_ls_mcps/main.pyRepository: openstack-lightspeed/rhos-mcps
Length of output: 103
🏁 Script executed:
Repository: openstack-lightspeed/rhos-mcps
Length of output: 1496
🏁 Script executed:
Repository: openstack-lightspeed/rhos-mcps
Length of output: 56
🏁 Script executed:
Repository: openstack-lightspeed/rhos-mcps
Length of output: 56
mTLS is not actually enabled when only
ssl_ca_certsis provided.At line 118, CA certs are passed to the SSL configuration, but
ssl_cert_reqsis never set. Without this, client certificates are not required or verified. According to Uvicorn's SSL documentation,ssl_cert_reqscontrols whether client certificates are enforced (default isssl.CERT_NONE); providingssl_ca_certsalone does not change this behavior. Bothssl_ca_certsandssl_cert_reqs=ssl.CERT_REQUIREDare required for mutual TLS enforcement.🔧 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dprince can you please resolve this comment please? You either accept the proposal by the AI or not in such a case you have to provide an explanation (and close the comment). We follow the rule that CodeRabbit comments need to be addressed first before human review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.