Tomasz Szkudlarek
Tomasz Szkudlarek

Reputation: 150

ValueError: check_hostname requires server_hostname, pip, windows

File "...\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\connection.py", line 500, in _connect_tls_proxy
return ssl_wrap_socket(
File "...\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py", line 453, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "...\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock) 
File "...\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 512, in wrap_socket
return self.sslsocket_class._create(
File "...\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1027, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname

Whatever I am trying - pip returns the same error message. And I am having a hard time tracking down the cause of this problem.

Environment: Windows 10 (latest build), Proxy. Proxy is set (also in the variables). And it works. Moreover, i wrote a simple python program retrieving the web page using urllib's request - and it works over this proxy server.

I've tried to force proxy in pip via command line, i've tried to use all these trusted-host parameters - everything fails. I reinstalled python directly from the web page. Nothing.

What's stranger - the very same proxy works flawlessly on linux systems. F.e. command:

pip3 install panda --proxy http://192.168.100.30:8088

Does work on Linux (same subnet, same proxy, same firewall), but fails on each Windows (i've tried the other systems) i try. This would mean that I am still missing some proxy settings on the Windows machine. But which? And why requests within python environment have no issues at all with the proxy?

Upvotes: 1

Views: 9299

Answers (3)

user6660160
user6660160

Reputation: 1

i had this problem. you should turn off your vpn .

Upvotes: 0

anonymous bear
anonymous bear

Reputation: 145

I also got the same error(pip, windows).

ValueError: check_hostname requires server_hostname

For those of you who have your VPN turned on, try to close the VPN and run the same command again. This solved my problem. Hope this helps

Upvotes: 2

Princewill Ezeidei
Princewill Ezeidei

Reputation: 187

Run the same command pip3 install panda --proxy http://192.168.100.30:8088 on windows, but before that, make sure no proxy is selected. You can do that by going to Internet Explorer >> Settings >> Internet Options >> Connections >> Lan Settings and unchecking all three checkboxes

enter image description here

Upvotes: 2

Related Questions