SSL Cert Expiry Sensor - not connecting

I’m trying to get the Cert Expiry sensor working to track my Comodo certificate. I’ve put the following in the configuration file:

- platform: cert_expiry
  host: hass.binstead.me.uk
  port: 8123

but my log always shows

[homeassistant.components.sensor.cert_expiry] Cannot connect to hass.binstead.me.uk

I have tested ssl-cert-check with the line

ssl-cert-check -s hass.binstead.me.uk -p 8123

and this responds

hass.binstead.me.uk:8123 Valid Oct 21 2020 1094

Can anybody offer any thoughts on what might be wrong here?
Thanks

I can’t help except to say that I have the same problem. I have tried all sorts of things and have never got this to work. If anybody has a solution to this I will also be very glad to hear it.

Did you find how to resolve it?

In my case the solution was that I was including the full https://[domain] under the host key.
You need to put the [domain] without prepending the https://

- platform: cert_expiry
name: "Certificate Expiry"
host: https://mydomain.org

is incorrect. I needed to do this:

  • platform: cert_expiry
    name: “Certificate Expiry”
    host: mydomain.org

Did not working for me :frowning: