1
fh = urllib.urlopen('https://docs.python.org/2/library/urllib.html',proxies=proxies)

where proxies is a dictionary as follows:

proxies['http'] = "http//user_name:password@ip:port"
proxies['https'] = "https//user_name:password@ip:port"

NOte: I have removed colon after http and https above because it is taken as a link and i am not allowed to post more than 2 links.

but i get following error:

407      def _real_connect(self, addr, return_errno):
IOError: [Errno socket error] [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

I tried what was given on "Python httplib SSL23_GET_SERVER_HELLO:unknown protocol" but that gave me following error:

 407     def _real_connect(self, addr, return_errno):
 IOError: [Errno socket error] [Errno 8] _ssl.c:510: EOF occurred in violation of protocol

Now it might be because of college proxy but i have supplied it through proxies.

Community
  • 1
  • 1
amritkrs
  • 632
  • 7
  • 12

1 Answers1

3

You missed the : in the URIs:

proxies['http'] = "http://user_name:password@ip:port"
proxies['https'] = "https://user_name:password@ip:port"
Klaus D.
  • 13,874
  • 5
  • 41
  • 48
  • 1
    Actually i have given colon but put it in a note here because stackexchange was treating it as a url which i didn't want to happen as i can post only 2 link. – amritkrs Mar 11 '15 at 10:17