<p dir="auto">Summary</p>
<p dir="auto">We try request module with below code spinet</p>
<p dir="auto">Our Proxy srver running on https</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
import requests
url = 'https://google.com'
roxies = {'https': '10.x.x.x:443'}
if __name__ == '__main__':
    print(url)
    print(roxies)
    response = requests.get(url, proxies=roxies)
    if response.status_code == 200:
        print(response.text)
    else:
        print ('Response ERROR', response.status_code)"><pre class="notranslate"><code class="notranslate">
import requests
url = 'https://google.com'
roxies = {'https': '10.x.x.x:443'}
if __name__ == '__main__':
    print(url)
    print(roxies)
    response = requests.get(url, proxies=roxies)
    if response.status_code == 200:
        print(response.text)
    else:
        print ('Response ERROR', response.status_code)
</code></pre></div>
<p dir="auto">Same connection we tried from curl its working fine.<br>
<code class="notranslate">  curl -v -x https://10.x.x.x:443 https://google.com</code></p>
<h2 dir="auto">Expected Result</h2>
<p dir="auto">Request module should connect to proxy server over https</p>
<p dir="auto">What you expected.</p>
<p dir="auto">Request module should connect to proxy server over https</p>
<h2 dir="auto">Actual Result</h2>
<p dir="auto">Request module giving following error while connecting to proxy server over https<br>
OSError('Tunnel connection failed: 400 Bad Request')))</p>
<p dir="auto">What happened instead.</p>
<h2 dir="auto">Reproduction Steps</h2>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import requests
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">requests</span></pre></div>
<h2 dir="auto">System Information</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -m requests.help"><pre class="notranslate"><code class="notranslate">$ python -m requests.help
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;paste here&gt;"><pre class="notranslate"><code class="notranslate">&lt;paste here&gt;
</code></pre></div>
<p dir="auto">This command is only available on Requests v2.16.4 and greater. Otherwise,<br>
please provide some basic information about your system (Python version,<br>
operating system, &amp;c).</p>
<p dir="auto">Hi,</p>
<p dir="auto">I described it here:<br>
<a href="http://stackoverflow.com/questions/20325571/python-requests-failing-over-integer-in-cookie" rel="nofollow">http://stackoverflow.com/questions/20325571/python-requests-failing-over-integer-in-cookie</a></p>
<p dir="auto">But basically this creates an error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import requests
r = requests.get('http://www.c1000.nl/kies-uw-winkel.aspx')
...   
File &quot;/srv/www/li/venv/local/lib/python2.7/site-packages/requests/cookies.py&quot;, line 270, in set_cookie
if cookie.value.startswith('&quot;') and cookie.value.endswith('&quot;'):
AttributeError: 'int' object has no attribute 'startswith'"><pre class="notranslate"><code class="notranslate">import requests
r = requests.get('http://www.c1000.nl/kies-uw-winkel.aspx')
...   
File "/srv/www/li/venv/local/lib/python2.7/site-packages/requests/cookies.py", line 270, in set_cookie
if cookie.value.startswith('"') and cookie.value.endswith('"'):
AttributeError: 'int' object has no attribute 'startswith'
</code></pre></div>
<p dir="auto">Is this a known issue? Is there any workaround? (i.e. do not parse cookies?)</p>