ciena / afkak

Kafka client written in Twisted Python
Apache License 2.0
32 stars 22 forks source link

TLS Failing #122

Closed ak-malla closed 1 year ago

ak-malla commented 2 years ago

I have started a broker with tls enabled,

def tls_client_endpoint(reactor, host, port):
    return wrapClientTLS(
        optionsForClientTLS(hostname=host),
        HostnameEndpoint(reactor, host, port),
    )
@defer.inlineCallbacks
def ready_client(reactor, netloc, topic):
    client = KafkaClient(netloc, reactor=reactor, endpoint_factory=tls_client_endpoint)
    e = True
    while e:
        try:
            yield client.load_metadata_for_topics(topic)
            e = client.metadata_error_for_topic(topic)
            if e:
                log.info("Error getting metadata for topic {}: {} (will retry)".format(topic, e))
        except Exception as err:
            log.info("Error getting metadata for topic {}: {} (will retry)".format(topic, err))

    defer.returnValue(client)

with the above code snippet, I am trying to run the consumer, but I am noticing

(2021-12-03 21:37:53,235) [INFO] Error getting metadata for topic linus_logs_app: Unable to load metadata from configured hosts: <twisted.python.failure.Failure afkak.common.KafkaUnavailableError: Failed to bootstrap from hosts [('127.0.0.1', 9093)]> (will retry)
...
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]`

can someone help me debug the issue ?

twm commented 2 years ago

There's nothing Afkak-specific here, so all I can suggest is generic advice:

Please let us know what works!