class_docstr: SSL implementation of TSocket
  
  This class creates outbound sockets wrapped using the
  python standard ssl module for encrypted connections.
docstr: Positional arguments: ``host``, ``port``, ``unix_socket``
  
  Keyword arguments: ``keyfile``, ``certfile``, ``cert_reqs``,
                     ``ssl_version``, ``ca_certs``,
                     ``ciphers`` (Python 2.7.0 or later),
                     ``server_hostname`` (Python 2.7.9 or later)
  Passed to ssl.wrap_socket. See ssl.wrap_socket documentation.
  
  Alternative keyword arguments: (Python 2.7.9 or later)
    ``ssl_context``: ssl.SSLContext to be used for SSLContext.wrap_socket
    ``server_hostname``: Passed to SSLContext.wrap_socket
  
  Common keyword argument:
    ``validate_callback`` (cert, hostname) -> None:
        Called after SSL handshake. Can raise when hostname does not
        match the cert.
    ``socket_keepalive`` enable TCP keepalive, default off.
docstr_tok: ["Positional","arguments",":","``","host","``",",","``","port","``",",","``","unix_socket","``","Keyword","arguments",":","``","keyfile","``",",","``","certfile","``",",","``","cert_reqs","``",",","``","ssl_version","``",",","``","ca_certs","``",",","``","ciphers","``","(","Python","2.7.0","or","later",")",",","``","server_hostname","``","(","Python","2.7.9","or","later",")","Passed","to","ssl.wrap_socket",".","See","ssl.wrap_socket","documentation",".","Alternative","keyword","arguments",":","(","Python","2.7.9","or","later",")","``","ssl_context","``",":","ssl.SSLContext","to","be","used","for","SSLContext.wrap_socket","``","server_hostname","``",":","Passed","to","SSLContext.wrap_socket","Common","keyword","argument",":","``","validate_callback","``","(","cert",",","hostname",")","-",">","None",":","Called","after","SSL","handshake",".","Can","raise","when","hostname","does","not","match","the","cert",".","``","socket_keepalive","``","enable","TCP","keepalive",",","default","off","."]
code: def __init__(self, host="localhost", port=9090, *args, **kwargs):
      """Positional arguments: ``host``, ``port``, ``unix_socket``
  
      Keyword arguments: ``keyfile``, ``certfile``, ``cert_reqs``,
                         ``ssl_version``, ``ca_certs``,
                         ``ciphers`` (Python 2.7.0 or later),
                         ``server_hostname`` (Python 2.7.9 or later)
      Passed to ssl.wrap_socket. See ssl.wrap_socket documentation.
  
      Alternative keyword arguments: (Python 2.7.9 or later)
        ``ssl_context``: ssl.SSLContext to be used for SSLContext.wrap_socket
        ``server_hostname``: Passed to SSLContext.wrap_socket
  
      Common keyword argument:
        ``validate_callback`` (cert, hostname) -> None:
            Called after SSL handshake. Can raise when hostname does not
            match the cert.
        ``socket_keepalive`` enable TCP keepalive, default off.
      """
      self.is_valid = False
      self.peercert = None
  
      if args:
          if len(args) > 6:
              raise TypeError("Too many positional argument")
          if not self._unix_socket_arg(host, port, args, kwargs):
              self._deprecated_arg(args, kwargs, 0, "validate")
          self._deprecated_arg(args, kwargs, 1, "ca_certs")
          self._deprecated_arg(args, kwargs, 2, "keyfile")
          self._deprecated_arg(args, kwargs, 3, "certfile")
          self._deprecated_arg(args, kwargs, 4, "unix_socket")
          self._deprecated_arg(args, kwargs, 5, "ciphers")
  
      validate = kwargs.pop("validate", None)
      if validate is not None:
          cert_reqs_name = "CERT_REQUIRED" if validate else "CERT_NONE"
          warnings.warn(
              "validate is deprecated. please use cert_reqs=ssl.%s instead"
              % cert_reqs_name,
              DeprecationWarning,
              stacklevel=2,
          )
          if "cert_reqs" in kwargs:
              raise TypeError(
                  "Cannot specify both validate and cert_reqs"
              )
          kwargs["cert_reqs"] = (
              ssl.CERT_REQUIRED if validate else ssl.CERT_NONE
          )
  
      unix_socket = kwargs.pop("unix_socket", None)
      socket_keepalive = kwargs.pop("socket_keepalive", False)
      self._validate_callback = kwargs.pop(
          "validate_callback", _match_hostname
      )
      TSSLBase.__init__(self, False, host, kwargs)
      TSocket.TSocket.__init__(
          self,
          host,
          port,
          unix_socket,
          socket_keepalive=socket_keepalive,
      )
  
imports: import logging
  import os
  import socket
  import ssl
  import sys
  import warnings
  from .sslcompat import _match_hostname, _match_has_ipaddress
  from thrift.transport import TSocket
  from thrift.transport.TTransport import TTransportException
label_desc: Use image node_id 1 to create a new TSSLSocket object from inherited base classes: TSocket, TSSLBase with example: obj = TSSLSocket(host, port)