Werk #16892: agent_kube: requests.SSLError raised on connection using self signed certificates

Komponente Checks & agents
Titel agent_kube: requests.SSLError raised on connection using self signed certificates
Datum 02.09.2024
Level Kleine Änderung
Klasse Bugfix
Kompatibilität Kompatibel - benötigt kein manuelles Eingreifen
Checkmk versions & editions
2.4.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0p15 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.2.0p33 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

Newer versions of requests don't take REQUESTS_CA_BUNDLE into account, resulting in

requests.exceptions.SSLError: \
    HTTPSConnectionPool(host='<collector>', port=443): \
        Max retries exceeded with url: \
            /metadata (Caused by SSLError( \
                SSLCertVerificationError(1, \
                    '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: \
                        self signed certificate in certificate chain (_ssl.c:1006)')))

being raised if running agent_kube against instances using self signed certificates.

This change invokes session.merge_environment_settings() to take REQUESTS_CA_BUNDLE into account again.

See GitHub: 2807: Use merge_environment_settings method in sessions.send method and GitHub: 3626: HTTP Proxy with prepared request (honouring env. var.)

Zur Liste aller Werks