@@ -47,12 +47,12 @@ async def run_session(
4747 logger .info ("Initialized" )
4848
4949
50- async def main (command_or_url : str , args : list [str ], env : list [tuple [str , str ]]):
50+ async def main (command_or_url : str , args : list [str ], env : list [tuple [str , str ]], disable_ssl_verification : bool ):
5151 env_dict = dict (env )
5252
5353 if urlparse (command_or_url ).scheme in ("http" , "https" ):
5454 # Use SSE client for HTTP(S) URLs
55- async with sse_client (command_or_url ) as streams :
55+ async with sse_client (command_or_url , verify_ssl = not disable_ssl_verification ) as streams :
5656 await run_session (* streams )
5757 else :
5858 # Use stdio client for commands
@@ -76,9 +76,15 @@ def cli():
7676 help = "Environment variables to set. Can be used multiple times." ,
7777 default = [],
7878 )
79+ parser .add_argument (
80+ "--disable-ssl-verification" ,
81+ nargs = "+" ,
82+ default = [],
83+ help = "Disable SSL verification when using HTTPS. SSL verification is enabled by default." ,
84+ )
7985
8086 args = parser .parse_args ()
81- anyio .run (partial (main , args .command_or_url , args .args , args .env ), backend = "trio" )
87+ anyio .run (partial (main , args .command_or_url , args .args , args .env , args . disable_ssl_verification if len ( args . disable_ssl_verification ) > 0 else False ), backend = "trio" )
8288
8389
8490if __name__ == "__main__" :
0 commit comments