question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ssl requests do not get passed through correctly

See original GitHub issue

As 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:open
  • Created 11 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ZuluProcommented, Jul 31, 2017

Any news ?

1reaction
gabrielfalcaocommented, Oct 11, 2022

HTTPretty needs some TLC which I intend to work on ASAP 😬

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found