Python3.6 - requests exceptions SSLError

Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance.

Hi,

I am having a problem with python3 script, that uses requests to perform API Get Request.

The problem is that the communication should go through proxy, i had similar issue using python3.6 -m pip install package_name, and figured it out by defining http_proxy and https_proxy to use "http://proxy_ip:port", however trying to do the same in the python script keeps failing, because the target destination only allow https communication, and routing the traffic through the http_proxy wont work in this case, but the https_proxy should be working fine from my browser, however when running the request get the below error:
"""
Traceback (most recent call last):
  File "/home/integration/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 700, in urlopen
    self._prepare_proxy(conn)
  File "/home/integration/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _prepare_proxy
    conn.connect()
  File "/home/integration/.local/lib/python3.6/site-packages/urllib3/connection.py", line 364, in connect
    conn = self._connect_tls_proxy(hostname, conn)
  File "/home/integration/.local/lib/python3.6/site-packages/urllib3/connection.py", line 507, in _connect_tls_proxy
    ssl_context=ssl_context,
  File "/home/integration/.local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 453, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
  File "/home/integration/.local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 495, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 407, in wrap_socket
    _context=self, _session=session)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 817, in __init__
    self.do_handshake()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 1077, in do_handshake
    self._sslobj.do_handshake()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:852)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/integration/.local/lib/python3.6/site-packages/requests/adapters.py", line 450, in send
    timeout=timeout
  File "/home/integration/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 786, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/integration/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ruh-services.sec.ibm.com', port=443): Max retries exceeded with url: /micro/ticket_detail (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/integration/.local/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/home/integration/.local/lib/python3.6/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/integration/.local/lib/python3.6/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/integration/.local/lib/python3.6/site-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/home/integration/.local/lib/python3.6/site-packages/requests/adapters.py", line 517, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='ruh-services.sec.ibm.com', port=443): Max retries exceeded with url: /micro/ticket_detail (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),))
"""

below is the python script i am using:

import requests
url="https://any_website"
response = requests.get(url, headers={"User-Agent": "Opera/9.80 (X11; Linux x86_64; U; de) Presto/2.2.15 Version/10.00"}, auth = ("UserName", "Password"), proxies={"https": "https://proxy_ip:port"})

note * the error message is the same for all destinations, as i barely get the error immediately after running the script"

Appreciate your support to identify the cause of such problem.

Thanks 

why you closed the case? @sigmavirus24 

You ignored the issue template telling you not to file an issue but to go to Stackoverflow. It's not a bug. Your proxy server is misbehaving probably because you've misconfigured it with requests. Stackoverflow can help better than we have the time to

Excuse me I didn't mean that.

Thank you 

@sigmavirus24 is there any other place to post my issue, as i am still stuck.