'Create SSL TSocket
@param validate: Set to False to disable SSL certificate validation
@type validate: bool
@param ca_certs: Filename to the Certificate Authority pem file, possibly a
file downloaded from: http://curl.haxx.se/ca/cacert.pem  This is passed to
the ssl_wrap function as the \'ca_certs\' parameter.
@type ca_certs: str
@param keyfile: The private key
@type keyfile: str
@param certfile: The cert file
@type certfile: str
Raises an IOError exception if validate is True and the ca_certs file is
None, not present or unreadable.'

def __init__(self, host='localhost', port=9090, validate=True, ca_certs=None, keyfile=None, certfile=None, unix_socket=None):

    self.validate = validate
    self.is_valid = False
    self.peercert = None
    if (not validate):
        self.cert_reqs = ssl.CERT_NONE
    else:
        self.cert_reqs = ssl.CERT_REQUIRED
    self.ca_certs = ca_certs
    self.keyfile = keyfile
    self.certfile = certfile
    if validate:
        if ((ca_certs is None) or (not os.access(ca_certs, os.R_OK))):
            raise IOError(('Certificate    Authority    ca_certs    file    "%s"    is    not    readable,    cannot    validate    SSL    certificates.' % ca_certs))
    TSocket.TSocket.__init__(self, host, port, unix_socket)
