Nagstamon - Python OpenSSL certificate validation

When I try to connect to my monitoring system with desktop widget Nagstamon, Nagstamon was not able to connect due to SSL certificate validation problem. I’m using certificate from CAcert.org. After a while of hacking I have found this workaround in source code. This is the wrong way:

