Implemented SSL Verification Disable#3450
Conversation
SSL Verification fix.
Fixed SSL verification.
Removed extra space.
Test Failure Analysis
Failure 1 —
|
Implemented fixes from the original Marvin analysis.
Updated client code after test failure.
Updated as per test failure.
Updated overloads as per prek.
Prek fixes.
Prek fixes.
More Prek fixes.
More Prek fixes.
Description
No AI was used in this code.
I have implemented SSL cert verification into the client.py so that it can be optionally disabled. This new param by default it is set to True, and not a required argument when the Client class is instantiated. It is my belief that the omission of this likely wasn't intentional, and this flag and capability exists in the underlying httpx transport protocol lib. This is also commonly available in libraries like requests, so it seemed logical to extend to this project. I implemented this with the same argument "verify" as requests lib uses, so most will likely be familiar and think to try it on their own. SSL cert verification disable is entirely valid while testing, and still affords encryption. And I think generally it should be up to developers and implementers to decide for themselves whether the authentication that a legitimate cert affords is required for their own use cases, it isn't a maintainers/creators role to decide that for them. There have been a few requests for this, and it required very minor tweaking to implement. Sadly there was a singular dependent function within the core MCP library, it just builds a simple object and I cant imagine it changes much from the source lib. I removed the import from the base MCP lib and moved it into http.py to finish implementing the SSL verification fix. The only reason to do this is it removes the need to file another separate PR into the core MCP lib just for a very simple function change. I will leave to you to decide if this acceptable or not. This code is fully tested and does work.
Quick example below:
There are no samples for client code in the readme on github so I didnt make any modifications to the readme. If this PR is approved we would likely want to update the documentation on the main site outside of GitHub.
Thanks!
Contributors Checklist
Review Checklist