I've looked everywhere that I can think of but not finding a method to get the client certificate that a client is using to connect via SSL.
The client code connects using ssl channel credentials like this:
creds = grpc.ssl_channel_credentials(
root_certificates=open('certs/ca_cert.pem').read(),
certificate_chain=open('certs/test_client_full.pem').read(),
private_key=open('certs/test_client_privkey.pem').read()
)
Now how do I access the public key (client certificate) from the server? I've examined what's available to me in the servicer context, in the request handler, in the metadata but there's been nothing.
My use case here is that I want to validate that the client certificate belongs to an entity using a hash of the cert.
Perhaps this is not possible using grpc-python?