code: def validate_tls(self, hostname):
          
  
          self._validate_path()
          validate_tls_hostname(self._context, self._certificate, hostname)
          return self._path
docs: Validates the certificate path, that the certificate is valid for
          the hostname provided and that the certificate is valid for the purpose
          of a TLS connection.
  
          :param hostname:
              A unicode string of the TLS server hostname
  
          :raises:
              certvalidator.errors.PathValidationError - when an error occurs validating the path
              certvalidator.errors.RevokedError - when the certificate or another certificate in its path has been revoked
              certvalidator.errors.InvalidCertificateError - when the certificate is not valid for TLS or the hostname
  
          :return:
              A certvalidator.path.ValidationPath object of the validated
              certificate validation path