Name or service not known on CONNECT call

I have a problem with some site in https: the first call in the log, a CONNECT request, fails with a

502 Bad gateway
ProtocolException(‘Server connection to (\‘\’, 443) failed: Error connecting to “”: [Errno -2] Name or service not known’,)

I search in source code but I don’t find where this message is raised.
What I have to check to solve the problem? Other https sites work well.


It was my problem: was unknown for the machine. I added the IP in the hosts file and error goes away.

I confess that error message is not so clear and helpful…