pumazi/wsgi_intercept2 — Issue #19: 19 - HTTPS intercept defaults to port 80 
Author: pumazi
Created: 2011-12-22 19:44:28+00:00
State: closed

What steps will reproduce the problem?
1. wsgi_intercept.add_wsgi_intercept('nonexistent-domain.com', 80, first_wsgi_app)
2. wsgi_intercept.add_wsgi_intercept('nonexistent-domain.com', 443, second_wsgi_app)
3. wsgi_intercept.urllib2_intercept.install_opener()
4. urllib2.urlopen('https://nonexistent-domain.com'

What is the expected output? What do you see instead?
This should trigger the "second_wsgi_app" intercept. Instead, it triggers the "first_wsgi_app" intercept.

What version of the product are you using? On what operating system?
I am using wsgi_intercept from SVN r50 trunk. This occurs on both Windows 7 and Ubuntu 10.04.

Please provide any additional information below.
I am attaching a patch that fixes this for urllib2 by creating a WSGI_HTTPSConnection class. It fixes the test case for HTTPS and adds a new test to ensure that the default port for HTTP remains 80. It also includes the patch from Issue 10 . I did not modify the other interceptors.

Original link: http://code.google.com/p/wsgi-intercept/issues/detail?id=19