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 (\‘example.site.com\’, 443) failed: Error connecting to “example.site.com”: [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.

Thanks.

It was my problem: example.site.com 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…