Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPS CONNECT over HTTP Proxy #552

Closed
chicagoben opened this issue May 15, 2013 · 2 comments
Closed

HTTPS CONNECT over HTTP Proxy #552

chicagoben opened this issue May 15, 2013 · 2 comments

Comments

@chicagoben
Copy link

I know I've seen lots of stack overflow questions about this. I cannot seem to figure out which version of python and which version of requests are needed to get this simple test working:

import requests.packages.urllib3 as urllib3
import unittest

class TestProxyConnect(unittest.TestCase):
def setUp(self):
self.proxy_url='http://192.168.201.138:3128/'
self.https_url='https://www.google.com/index.html'
def test_connect(self):
proxy=urllib3.proxy_from_url(self.proxy_url)
res=proxy.urlopen('GET', self.https_url)
self.assertEqual(res.status, 200)

if name == 'main':
unittest.main()

F

FAIL: test_connect (main.TestProxyConnect)

Traceback (most recent call last):
File "/root/test.py", line 11, in test_connect
self.assertEqual(res.status, 200)
AssertionError: 501 != 200

It's just trying to use squid. I know this is more urllib3, but I am using the urllib3 that is in the requests 'packages' folder.

(venv)[root@cb-server-test urllib3]# pip freeze
requests==1.2.0
wsgiref==0.1.2

Can anyone help me figure out how to get HTTPS requests over HTTP to use CONNECT?

Thanks,
Ben

@mikeal
Copy link
Member

mikeal commented Aug 28, 2014

Is this still an issue?

This is so old I'm closing, if it is actually still an issue just let me know and I'll re-open.

@mikeal mikeal closed this as completed Aug 28, 2014
@nylen
Copy link
Member

nylen commented Aug 28, 2014

Wrong library; wrong programming language even :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants