import requests
import ssl

from requests_ntlm import HttpNtlmAuth

from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
from requests.packages.urllib3.util.ssl_ import create_urllib3_context

# This is the 2.11 Requests cipher string.
CIPHERS = (
    'DES-CBC3-SHA:ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'
    'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'
    '!eNULL:!MD5'
)

class DESAdapter(HTTPAdapter):
    def init_poolmanager(self, connections, maxsize, block=False,*args, **kwargs):
        context = create_urllib3_context(ciphers=CIPHERS)
        kwargs['ssl_context'] = context
        self.poolmanager = PoolManager(
            num_pools=connections, maxsize=maxsize,
            block=block, ssl_version=ssl.PROTOCOL_TLS,*args, **kwargs) 
            #block=block, ssl_version=ssl.PROTOCOL_SSLv3,*args, **kwargs) 

requests.packages.urllib3.disable_warnings()
            
if __name__=="__main__":

    s = requests.Session()
    s.mount('https://', DESAdapter())
    
    username="someuser"
    password="thepassword"


    url="https://10.192.8.89:8080/yps_report/share_dir/ONEDAYDEAL"
    
    r = s.get(url,auth=HttpNtlmAuth(username,password),verify=False)
    
    print(r.status_code)

