parameters: (sock, keyfile=None, certfile=None)
return_statement: return ssl_sock
docstring: A replacement for the old socket.ssl function.  Designed
      for compability with Python 2.5 and earlier.  Will disappear in
      Python 3.0.
docstring_summary: A replacement for the old socket.ssl function.  Designed
      for compability with Python 2.5 and earlier.  Will disappear in
      Python 3.0.
docstring_tokens: A replacement for the old socket . ssl function . Designed for compability with Python 2 . 5 and earlier . Will disappear in Python 3 . 0 .
function: def sslwrap_simple(sock, keyfile=None, certfile=None):
  
      """A replacement for the old socket.ssl function.  Designed
      for compability with Python 2.5 and earlier.  Will disappear in
      Python 3.0."""
  
      if hasattr(sock, "_sock"):
          sock = sock._sock
  
      ssl_sock = _ssl.sslwrap(sock, 0, keyfile, certfile, CERT_NONE,
                              PROTOCOL_SSLv23, None)
      try:
          sock.getpeername()
      except socket_error:
          # no, no connection yet
          pass
      else:
          # yes, do the handshake
          ssl_sock.do_handshake()
  
      return ssl_sock
function_tokens: def sslwrap_simple ( sock , keyfile = None , certfile = None ) : if hasattr ( sock , "_sock" ) : sock = sock . _sock ssl_sock = _ssl . sslwrap ( sock , 0 , keyfile , certfile , CERT_NONE , PROTOCOL_SSLv23 , None ) try : sock . getpeername ( ) except socket_error : # no, no connection yet pass else : # yes, do the handshake ssl_sock . do_handshake ( ) return ssl_sock