{"record":{"id":"cd0889e23d8680fa","repo":"PrefectHQ/fastmcp","slug":"both-httpx-client-factory-and-verify-were-prov-cd0889","errorCode":null,"errorMessage":"Both 'httpx_client_factory' and 'verify' were provided. The 'verify' parameter will be ignored because 'httpx_client_factory' takes precedence. Configure SSL verification directly in your httpx_client_factory instead.","messagePattern":"Both 'httpx_client_factory' and 'verify' were provided\\. The 'verify' parameter will be ignored because 'httpx_client_factory' takes precedence\\. Configure SSL verification directly in your httpx_client_factory instead\\.","errorType":"console","errorClass":"UserWarning","httpStatus":null,"severity":"warning","filePath":"fastmcp_slim/fastmcp/client/transports/sse.py","lineNumber":65,"sourceCode":"        verify: ssl.SSLContext | bool | str | None = None,\n    ):\n        if isinstance(url, AnyUrl):\n            url = str(url)\n        if not isinstance(url, str) or not url.startswith(\"http\"):\n            raise ValueError(\"Invalid HTTP/S URL provided for SSE.\")\n\n        # Don't modify the URL path - respect the exact URL provided by the user\n        # Some servers are strict about trailing slashes (e.g., PayPal MCP)\n\n        self.url: str = url\n        self.headers = headers or {}\n        self.httpx_client_factory = httpx_client_factory\n        self.verify: ssl.SSLContext | bool | str | None = verify\n\n        if httpx_client_factory is not None and verify is not None:\n            import warnings\n\n            warnings.warn(\n                \"Both 'httpx_client_factory' and 'verify' were provided. \"\n                \"The 'verify' parameter will be ignored because \"\n                \"'httpx_client_factory' takes precedence. Configure SSL \"\n                \"verification directly in your httpx_client_factory instead.\",\n                UserWarning,\n                stacklevel=2,\n            )\n\n        self._set_auth(auth)\n\n        self.sse_read_timeout = normalize_timeout_to_timedelta(sse_read_timeout)\n\n    def _set_auth(self, auth: httpx2.Auth | Literal[\"oauth\"] | str | None):\n        resolved: httpx2.Auth | None\n        if auth == \"oauth\":\n            resolved = OAuth(\n                self.url,\n                httpx_client_factory=self.httpx_client_factory","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/PrefectHQ/fastmcp/blob/1f021142978e0861cd910c8df4e8074bc7cf3978/fastmcp_slim/fastmcp/client/transports/sse.py#L47-L83","documentation":"Same conflict as in the http transport: `SSETransport` accepts `verify` and `httpx_client_factory`; when both are provided the factory wins and `verify` is ignored, raising a `UserWarning` from `__init__`.","triggerScenarios":"`SSETransport(url, verify=\"certs/ca.pem\", httpx_client_factory=factory)` — any non-None combination of both arguments.","commonSituations":"Migrating SSE transports from plain `verify=` usage to custom httpx client factories; shared config builders that always set both.","solutions":["Move the SSL setting into the factory: `httpx.AsyncClient(verify=\"certs/ca.pem\", ...)`.","Remove the redundant `verify=` argument.","Or keep `verify` and drop the factory if a default client suffices.","Add a config-layer assertion that only one of the two is set."],"exampleFix":"// before\nSSETransport(url, verify=\"ca.pem\", httpx_client_factory=lambda **kw: httpx.AsyncClient(**kw))\n// after\ndef factory(**kw):\n    return httpx.AsyncClient(verify=\"ca.pem\", **kw)\nSSETransport(url, httpx_client_factory=factory)","handlingStrategy":"validation","validationCode":"assert not (httpx_client_factory is not None and verify is not None), \"Configure SSL in the httpx_client_factory instead of passing verify\"\n","typeGuard":null,"tryCatchPattern":"import warnings\nwith warnings.catch_warnings(record=True) as caught:\n    warnings.simplefilter(\"always\")\n    t = SSETransport(url, verify=verify, httpx_client_factory=factory)\nif any(\"'verify' parameter will be ignored\" in str(w.message) for w in caught):\n    logging.warning(\"verify ignored by SSETransport; move SSL into factory\")","preventionTips":["Move verify settings into the shared client factory","Keep one transport factory helper for SSE and HTTP transports","Enable warnings-as-errors for transport construction in tests"],"tags":["python","ssl","httpx","sse","transport"],"backgroundTag":"conflicting-options-ignored","analyzedSha":"1f021142978e0861cd910c8df4e8074bc7cf3978","analyzedAt":"2026-08-29T14:31:16.082Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}