Adding a ssl_verify flag to the sse_client asynccontextmanager function in the sse client library #505
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.
This pull request adds an optional ssl_verify parameter that defaults to true in the SSE client so that development can be conducted using servers running on HTTPS but with self signed certificates.
Motivation and Context
I have a need to test locally on servers running self signed certificates and I kept getting self signed verification issues and it did not seem to be possible to skip verification without adding a parameter to the httpx AsyncClient. When I added this parameter everything worked as expected.
How Has This Been Tested?
This pull request does not make material changes to the functionality itself outside of configurability of the httpx client objects for SSE but I have run all the tests, linting, and format checks outlined in the CONTRIBUTING text. Everything works as expected.
Breaking Changes
This pull request does not introduce any breaking changes. It just adds an extra parameter at the end of the sse_client function prototype.
Types of changes
Checklist
Additional context
This is a feature easily found by looking at the function definition and there was no direct documentation section but I am happy to add documentation if needed in other repositories. Since this change does not alter the implementation of the MCP Python SDK itself, but instead passes an extra parameter to the httpx client instantiator, there was no error handling to update that does not already exist.