title: how to perform https requests over an SSLsocket in python
body: <p>I am using the following code to perform and ssl handshake and certificate validation with an ssl server.</p>
  
  <pre><code>import ssl
  import socket
  
  s = socket.socket()
  print "connecting..."
  #logging.debug("Connecting")
  # Connect with SSL mutual authentication
  # We only trust our server's CA, and it only trusts user certificates signed by it
  c = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED,
                      ssl_version=ssl.PROTOCOL_SSLv3, ca_certs='ca.crt',
                      certfile='user.crt', keyfile='user.key')
  c.connect((constants.server_addr, constants.port))
  </code></pre>
  
  <p>I am able to get a connection to the server and the certificate is validated correctly, however, I am not sure what to do from here.  I need to perform https actions over the socket, including posting XML to a REST API.  How do I go about this?</p>