title: ssl connection using python 2.7.13 requests
body: <p>I tried to use python requests package to connect over SSL and i used below code.</p>
  
  <pre><code>resp = requests.get(addr , auth=HttpNtlmAuth(userFile[unum],passFile[pnum]) , headers = {'User-Agent':'Mozilla/4.01 (compatible; MSIE 6.0; Windows NT 5.1)'} , verify = False)
  </code></pre>
  
  <p>but every time i got below error.</p>
  
  <pre><code>("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
  </code></pre>
  
  <p>UPDATE 1:</p>
  
  <p>I dump host certificate and save that to c.cert and used below code.</p>
  
  <pre><code>resp = requests.get(addr , auth=HttpNtlmAuth(userFile[unum],passFile[pnum]) , headers = {'User-Agent':'Mozilla/4.01 (compatible; MSIE 6.0; Windows NT 5.1)'} , cert = '/home/user/Desktop/c.cert' , verify = '/home/user/Desktop/c.cert')
  </code></pre>
  
  <p>and new error.</p>
  
  <pre><code>[('PEM routines', 'PEM_read_bio', 'no start line'), ('SSL routines', 'SSL_CTX_use_PrivateKey_file', 'PEM lib')]
  </code></pre>
  
  <p>UPDATE 2 :</p>
  
  <p>Here is what Burp Suite captured.</p>
  
  <p>(First , session creation):</p>
  
  <pre><code>GET /PATH HTTP/1.1
  Host: HOST
  User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language: en-US,en;q=0.5
  Cookie: ASPSESSIONIDCQCTCTCQ=EPEHGDDAKOINODAJJKCELEOK
  DNT: 1
  Connection: close
  Upgrade-Insecure-Requests: 1
  Cache-Control: max-age=0
  </code></pre>
  
  <p>(Second , when use credentials):</p>
  
  <pre><code>GET /PATH HTTP/1.1
  Host: HOST
  User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language: en-US,en;q=0.5
  Cookie: ASPSESSIONIDCQCTCTCQ=EPEHGDDAKOINODAJJKCELEOK
  DNT: 1
  Upgrade-Insecure-Requests: 1
  Cache-Control: max-age=0
  Authorization: NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=
  Connection: close
  </code></pre>
  
  <p>(Third , credentials was wrong)</p>
  
  <pre><code>GET /PATH HTTP/1.1
  Host: HOST
  User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language: en-US,en;q=0.5
  Cookie: ASPSESSIONIDCQCTCTCQ=EPEHGDDAKOINODAJJKCELEOK
  DNT: 1
  Upgrade-Insecure-Requests: 1
  Cache-Control: max-age=0
  Authorization: NTLM TlRMTVNTUAADAAAAGAAYAGAAAACIAIgAeAAAAAAAAABAAAAACgAKAEAAAAAWABYASgAAAAAAAAAAAAAABYIIAGEAZABtAGkAbgBXAE8AUgBLAFMAVABBAFQASQBPAE4Ao8+kG6lMZcLmQys5IUkpayq+W1VFZPkjUQjxBhzugt88vU6RR3wahQEBAAAAAAAAgPonWPz30gGr58MfeUgvgQAAAAACABIAVwBFAEIAUwBFAFIAVgBFAFIAAQASAFcARQBCAFMARQBSAFYARQBSAAQAEgBXAEUAQgBTAEUAUgBWAEUAUgADABIAVwBFAEIAUwBFAFIAVgBFAFIAAAAAAA==
  Connection: close
  </code></pre>
  
  <p>when using URL without HTTPS it gives me page with below custom error</p>
  
  <p><strong>Bad Request (Invalid Hostname)</strong></p>