openapi-python-client icon indicating copy to clipboard operation
openapi-python-client copied to clipboard

Support Client Side Certificates

Open marioland opened this issue 3 years ago • 1 comments

It would be nice if the generated client would support client side certificates. This would be an additional authentication method used in secured environments. The underlaying httpx lib does support it with a named argument "cert": https://www.python-httpx.org/advanced/#client-side-certificates

I was not able to get the kwargs from the openapi-python-client passed through to httpx.

marioland avatar Jun 01 '22 15:06 marioland

I believe, Client side certificate is already available. I use it following way,

 ssl_certificate: str = str(Path(__file__).parent.joinpath("client_Certificates.pem").resolve())
  
   rest_client = Client(
        base_url=v3_rest_uri,
        headers=basic_auth_header,
        timeout=60,
        verify_ssl=ssl_certificate
    )

Then use the client while calling any REST API.

bakkiaraj avatar Sep 28 '22 15:09 bakkiaraj

Another case where #202 will solve the issue once we get to it.

dbanty avatar Nov 12 '22 19:11 dbanty