SSLError 'certificate verify failed' Version: 2.1.0p33, OS: linux with self signed certificate

If your certificate looks like this

and you call it with this

then the error message is perfectly fine.
The CNs and also the SANs should match the called names.