title: ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:661) python2.7
body: <p>I have tried every kind of number and option given to me, even went into the protocol section of bash and looked all over various sites, no matter what do with my code i can't get away from that error(as said in title), this is my code and full error message, hopefully someone can point me in the right direction, i'd really appreciate that.
  Versions i've tried:</p>
  
  <pre><code>SSLv2,SSLv3,SSLv23[1],TLSv1,TLSv1_1,TLSv1_2 with all proper apache 
  configurations, and encryption when making the SSL self-signed cert 
  </code></pre>
  
  <p>version of server:</p>
  
  <pre><code>cert is version 3
  cert signature algorithm is PKCS #1 SHA-256 With RSA Encryption
  </code></pre>
  
  <p>Version of kali linux i'm running:</p>
  
  <pre><code>4.14.0-kali1-amd64
  </code></pre>
  
  <p>Error message: </p>
  
  <pre><code>anon@kali:~/Desktop/python scripts$ python SSL\ client.py 
  Traceback (most recent call last):
  File "SSL client.py", line 21, in &lt;module&gt;
  ssl_socket = context.wrap_socket(c, server_side=False, 
  do_handshake_on_connect=True, suppress_ragged_eofs=True, 
  server_hostname='vulnerable')
  File "/usr/lib/python2.7/ssl.py", line 363, in wrap_socket
  _context=self)
  File "/usr/lib/python2.7/ssl.py", line 611, in __init__
  self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 840, in do_handshake
  self._sslobj.do_handshake()
  ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number 
  (_ssl.c:661)
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>import socket
  import requests
  import ssl
  
  t_host = "vulnerable"
  t_port = 443
  
  
  c = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  c.connect((t_host,t_port))
  c.send(b"GET / HTTP/1.1\r\nHost: vulnerable\r\n\r\n")
  getRequest = "GET /HTTP/1.1\r\nHost: vulnerable\r\n\r\n"
  requests.packages.urllib3.disable_warnings()
  r = requests.get('https://vulnerable/',verify=False)
  
  context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
  context.verify_mode = ssl.CERT_REQUIRED
  context.check_hostname = True
  context.load_verify_locations(cafile="/etc/ssl/certs/apache-selfsigned.crt")
  
  ssl_socket = context.wrap_socket(c, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True, server_hostname='vulnerable')
  ssl_socket.connect(('vulnerable', 443 ))
  re = c.recv(4096)
  ssl_socket.send(getRequest)
  print ssl_socket.recv(1024)
  print ssl_socket.recv(1024)
  print (re.decode('UTF-8'))
  print r.text
  </code></pre>
  
  <p>Result i am looking for when ran successfully:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Wed, 30 Nov 2016 01:02:13 GMT
  Server: Apache/2.4.18 (Ubuntu)
  Last-Modified: Tue, 29 Nov 2016 11:13:07 GMT
  ETag: "70-5426eac41e995"
  Accept-Ranges: bytes
  Content-Length: 112
  Vary: Accept-Encoding
  Content-Type: text/html
  </code></pre>