Skip to content

Not sure how mutualTLS works #107

@malabile

Description

@malabile

I have a openapi yaml with the following code:

components:
  securitySchemes:
    mtls:
      type: mutualTLS

Using openapi3-1.8.1, connecting using the Following method fails:

        api = OpenAPI(
            raw_document=spec,
            ssl_verify=Path("ca.pem"),
        )

        api.authenticate(
            "mtls",
            (
                Path("otsbms.pem"),
                Path("otsbms.key.pem"),
            ),
        )

        # call operations and receive result models
       api.call_deleteAll(parameters={"personId": "a123", "transactionId": "a456", })

unless I change line 344 in paths.py and add the "cert" arg

        # send the prepared request
        result = session.send(self._request.prepare(), verify=verify, cert=self._request.cert)

With the above code, mutualTLS works for me. But breaks all other methods that do not set self._request.cert

I don't see in the source code for self._request.prepare() that it copies the cert variable. I don't undersatnd how it could work.
On the other hand, support for mutualTLS was explicitly added in openapi3 so it has been tested. I am not sure if there is a bug, or if I missed something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions