This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jhp7e
Recipients jhp7e, orsenthil
Date 2013-03-29.14:07:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1364566058.63.0.518687864528.issue17569@psf.upfronthosting.co.za>
In-reply-to
Content
Here is the code (security info removed) and the output. I noticed that the problem is a bit different between 2.6.5 and 2.7.3 (on one the use of authentication is different) so I've included the output for both:

import urllib2

userData="Basic XXXX KEY GOES HERE"

emlUrl="https://pasta.lternet.edu/package/metadata/eml/knb-lter-vcr/25/27"
emlReq=urllib2.Request(emlUrl)
emlReq.add_header('Authorization', userData)
emlSock=urllib2.urlopen(emlReq,timeout=60)
emlString=emlSock.read()
print "Https,authenticated: "+str(len(emlString))

emlReq=urllib2.Request(emlUrl)
emlSock=urllib2.urlopen(emlReq,timeout=60)
emlString=emlSock.read()
print "Https,Not authenticated: "+str(len(emlString))

emlUrl="http://pasta.lternet.edu/package/metadata/eml/knb-lter-vcr/25/27"
emlReq=urllib2.Request(emlUrl)
emlReq.add_header('Authorization', userData)
emlSock=urllib2.urlopen(emlReq,timeout=60)
emlString=emlSock.read()
print "Http,authenticated: "+str(len(emlString))


emlReq=urllib2.Request(emlUrl)
emlSock=urllib2.urlopen(emlReq,timeout=60)
emlString=emlSock.read()
lengthHttpsNotAuthenticated=len(emlString)
print "Http,authenticated: "+str(len(emlString))

OUTPUT when run on PC using Python 2.6.5
Https,authenticated: 32768
Https,Not authenticated: 32768
Http,authenticated: 40898
Http,authenticated: 40898

OUTPUT when run on Ubuntu Linux (12.4LTS):
Https,authenticated: 32768
Https,Not authenticated: 40898
Http,authenticated: 40898
Http,authenticated: 40898
History
Date User Action Args
2013-03-29 14:07:38jhp7esetrecipients: + jhp7e, orsenthil
2013-03-29 14:07:38jhp7esetmessageid: <1364566058.63.0.518687864528.issue17569@psf.upfronthosting.co.za>
2013-03-29 14:07:38jhp7elinkissue17569 messages
2013-03-29 14:07:38jhp7ecreate