Openshift python requests proxy permission denied
<p>I'm trying to use a proxy with the python 'requests' package on an Openshift server.  I am getting a permission denied error. See below.</p>

<p>Is Openshift blocking the connection or am I not configuring it correctly? Something else?  Openshift doesn't want to let me connect to a proxy because the code works fine locally and on Heroku.</p>

<p><strong>Code</strong></p>

<pre><code>from ssl import PROTOCOL_TLSv1
import ssladapter

proxies = {'https': 'http://{}:{}@96.44.147.34:6060'.format(CFG.proxy_username, CFG.proxy_password)}

url1 = 'https://reservaciones.volaris.com/Flight/DeepLinkSearch'                    

session = requests.Session()
session.mount('https://', ssladapter.SSLAdapter(ssl_version=PROTOCOL_TLSv1))

request1 = session.get(url1, proxies=proxies)   
</code></pre>

<p><strong>Traceback</strong></p>

<pre><code>requests.exceptions.ProxyError: HTTPSConnectionPool(host='reservaciones.volaris.com', port=443): Max retries exceeded with url: /Flight/DeepLinkSearch (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('&lt;requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4e78386ad0&gt;: Failed to establish a new connection: [Errno 13] Permission denied',)))
</code></pre>

<p>Most probably OpenShift blocks uncommon outgoing ports for <a href="http://security.stackexchange.com/questions/24310/why-block-outgoing-network-traffic-with-a-firewall">security reasons</a>. your proxy is listening on 6060. You should try to ssh into your gear and try <code>telnet</code></p>

<p>In my gear, post 6060 is blocked. See the attached screenshot. <a href="http://portquiz.net/" rel="nofollow">portquiz</a> listens on all TCP ports.</p>

<p><a href="http://i.stack.imgur.com/tdBWP.png" rel="nofollow"><img src="http://i.stack.imgur.com/tdBWP.png" alt="enter image description here"></a></p>

python proxy openshift python-requests