Currently, RESTful sensors only support authentication methods of basic
or digest
. It would be great if it could support certificate client authentication.
My use case for this is that I have some other self-hosted services which have APIs and I’d like to pull that data into home assistant, but I generally like to have as many of my services behind client authentication as possible. So I can’t use these with home assistant unless I disable client authentication for them.
My thoughts on implementation would be to add a new type like client_certificate
, and add a new configuration variable (something like certificate_file
) which would point to a pkcs12 file (containing the client cert and private key). You’d also need a way to specify the password for that pkcs12 package, maybe that could just use the existing password variable, or add a new one. Alternatively, there could be two options, one that points to the certificate file and one that points to the key file (similar to ssl_certificate/ssl_key in the http integration).