Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Strip trailing dot off hostname used for SSL validation. #133

Merged
merged 4 commits into from
Mar 10, 2024

Conversation

wbarnha
Copy link
Collaborator

@wbarnha wbarnha commented Mar 8, 2024

When using FQDN's with trailing dots to connect to a broker, the trailing dot in the hostname should be stripped before using the hostname for validation against the server's certificate.

For instance, this code:

producer = KafkaProducer(
        bootstrap_servers="redpanda.redpanda.svc.cluster.local.:9093",
        security_protocol="SSL",
)

Will cause certificate validation to fail when the subject name doesn't contain the trailing dot.

For some context, this is also a problem with librdkafka: confluentinc/librdkafka#4348

The current stance from the OpenSSL team is this is an application layer issue: openssl/openssl#11560


This change is Reviewable

@wbarnha wbarnha merged commit b1a4c53 into kafka-python-ng:master Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants