ssl requests do not get passed through correctly
See original GitHub issueAs demonstrated by the shell session below, there is a bug in how ssl is handled when passing through HTTPretty. I didn’t see a note in the readme about it having this limitation.
>>> import requests
>>> from httpretty import HTTPretty
>>> url = 'https://www.cloudflare.com/ips'
>>>
>>> response = requests.get(url)
>>> original_content = response.content
>>>
>>> HTTPretty.reset()
>>> HTTPretty.enable()
>>>
>>> response = requests.get(url)
>>> new_content = response.content
>>> print new_content == original_content
False
>>>
>>> HTTPretty.disable()
>>> response = requests.get(url)
>>> newer_content = response.content
>>> print newer_content == original_content
True
>>> print new_content
<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
Issue Analytics
- State:
- Created 11 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
8 Ways to Fix SSL Connection Errors on Various Browsers ...
Discover 8 effective ways to fix SSL connection errors on various browsers, OSs, and platforms. Don't scare your users away.
Read more >A Simple Explanation of SSL Certificate Errors & How to Fix ...
This error indicates that the SSL certificate is signed or approved by a company that the browser does not trust. That means either...
Read more >Python Requests throwing SSLError - Stack Overflow
The problem you are having is caused by an untrusted SSL certificate. Like @dirk mentioned in a previous comment, the quickest fix is...
Read more >What is an SSL certificate and How to fix SSL Errors?
Not correctly installed SSL on the server – If one of the chain certificates between yours and the root certificate is not properly...
Read more >Troubleshooting SSL related issues (Server Certificate)
The first 2 steps check the integrity of the certificate. Once we have confirmed that there are no issues with the certificate, a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any news ?
HTTPretty needs some TLC which I intend to work on ASAP 😬