I’m wondering if anyone here has encountered anything like this as I’m running out of ideas to resolve the issue below.
My logfiles are being spammed roughly every 12 seconds with the message:
Nov 06 18:24:43 hass hass[19909]: /srv/homeassistant/lib/python3.6/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings Nov 06 18:24:43 hass hass[19909]: InsecureRequestWarning)
I have the tried setting the logger default to warning, error, fatal, and critical. With logger set to critical the only messages I’m seeing are these errors. I’ve attempted to nail down just these errors with the following configuration.yaml settings:
The error text leads to a link which suggests pip install certifi as a solution, which I’ve confirmed is available in my deployed venv.
For the unifi component I’ve set verify_ssl: false. My UniFi installation is utilizing self-signed certs from a local CA, so I’ve added my CA’s .crt to usr/share/ca-certificates/extra and ran sudo dpkg-reconfigure ca-certificates to import the CA. Testing access to the URL from the cli via wget https://unifi.domain.net:8443 returns a successful certificate check.
The only solution I’ve found to stop it is to completely disable the UniFi component. There appears to be a bug report for this issue from 6 months ago that suggests the issue is now fixed, but I’ve only seen this starting in the last few weeks (had to delete old logs as I ran out of disk because of this issue, so I don’t have an exact start date).
My system is running Ubuntu 17.04, hass 0.57.2, python 3.6.1, and UniFi 5.6.20 Stable
I’m not sure I understand, can you explain a bit? I have verify_ssl: false set in the UniFi configuration. This system is not exposed to the internet making LetsEncrypt a problem. I have a local CA which I use to issue certificates, which I’ve deployed to this system and which can be successfully verified (chained from UniFi to my CA) with openssl s_client -connect unifi.<mydomain>.net:9443
With some further research it appears that Python virtualenvs might not be pulling the list of CAs from the system.
Yes. It does not check cert because you set ssl_verify =false.
When you choose ssl_verify =false it gives error to say, “hey, you are doing something less secure than recommended and we want you to know this. You may ignore this message but do so at your own risk”.
If ssl_verify=true and using ssl cert signed by CA, this error will disappear. I did not test or verify but this is expected function and error cause as I understand it.
EDIT
You are logging into what is likely critical network security piece. You are providing credentials to unverified (could be spoofed but not likely) server. Verify_ssl=false is kind of a leap of faith.
That actually worked! I’m not sure why disabling verification would cause this degree of log spew, but enabling verification does now seem to be able to pick up my UniFi system’s cert and chain it to my CA (or if not, it’s stopped complaining about it). Either way my logs are back to their normal state, so thanks!
edit: ugh spoke too soon - that got rid of the errors by just not working at all, presumably as it’s failing the SSL check on account of not having and CAs defined.
After searching for what seems like forever, a definitive answer can be had.
Setting a ENV var
PYTHONWARNINGS=“ignore:Unverified HTTPS request”
either at a system level, or at the execution level of hass, or injected into the docker run will quite these down
I eventually resolved the issue by utilizing LetsEncrypt certs on the unifi host. Now it has auto-renewing certs which are trusted by all (most?) clients and the result has been an end to the months of log spew it was previously creating.
I’m running Home Assistant and Unifi Controller in docker containers on a Synology DSM-918+.
Your answer was the only solution after reaching the end of the internet …
Now the log is not spammed with Unifi messages, I don’t know if we just covered up the rust with fresh paint, but it sure did stop those messages from spamming the logs every 10 seconds.
Now I only have to deal with random but frequent “Timer got out of sync. Resetting” messages.
Trying it with docker-compose and setting PYTHONWARNINGS=“ignore:Unverified HTTPS request” isn’t working for me. I entered the container and can see it set looking at export and set, but I still get that warning