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
[httplib] httplib.BadStatusLine on any HTTPS connection in certain unknown cases. #59287
Comments
When trying to POST /anything/ @ https://grooveshark.com/, I get an httplib.BadStatusLine exception (server returns nothing at all. It's a timeout since it waits a while). The many Grooveshark webclients however works perfectly, along with a curl command (run through cygwin, commented out in the script) that does the exact same. Meaning this weird behavior is exclusive to Python. This issue was found to be present on many Windows systems. However, not all (all the systems have Python 2.7.2). I'm not sure what the difference is, and I'm not sure if this is a Python bug, but this is the only place I could think of to discuss the behavior. The only Linux system I've tested this on worked (again, Python 2.7.2). The code *used* to work yesterday and it's been working for many months. Grooveshark might have changed something but this doesn't make any sense since curl works. Please try to reproduce this. I can provide any testing details needed. Excuse my complete ignorance on the inner workings of SSL and my weak English skills (second language). |
I can reproduce this, and it seems to stem from the openssl version used (0.9.8l). Running openssl s_client -connect grooveshark.com:443 with 0.9.8l gives CONNECTED(00000003)
depth=3 /L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert Class 2 Policy Validation Authority/CN=http://www.valicert.com//emailAddress=info@valicert.com
verify error:num=19:self signed certificate in certificate chain
verify return:0
22456:error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block type is not 01:rsa_pk1.c:100:
22456:error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check failed:rsa_eay.c:697:
22456:error:1408D07B:SSL routines:SSL3_GET_KEY_EXCHANGE:bad signature:s3_clnt.c:1448: With 1.0.1c, it gives CONNECTED(00000003)
depth=3 L = ValiCert Validation Network, O = "ValiCert, Inc.", OU = ValiCert Class 2 Policy Validation Authority, CN = http://www.valicert.com/, emailAddress = info@valicert.com
verify error:num=19:self signed certificate in certificate chain
verify return:0 Certificate chain i.e. the connection gets established. The next bug fix release of Python 2.7 will include OpenSSL 0.9.8x, which is the latest OpenSSL 0.9.8 bug fix. It still shows the error in connecting, so I wonder whether this is a bug that just doesn't get fixed for 0.9.8, or whether it's a bug in the server (that 1.0.1 somehow avoids). |
I can confirm that. I built a 1.0.1c version of both _ssl.pyd and _ssl.lib and now the problem's solved (they're attached if ever needed). Thanks! |
I can confirm similar behaviour in RHEL 6.3 with python 2.6.6. |
Can you please retest with Python 2.7.8 as this has an updated version of openssl. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: