Page MenuHomePhabricator
Paste P17333

Python kafka client and SSL
ActivePublic

Authored by dcausse on Sep 28 2021, 7:36 AM.
Tags
None
Referenced Files
F34660144: Python kafka client and SSL
Sep 28 2021, 8:40 AM
F34660021: Python kafka client and SSL
Sep 28 2021, 7:36 AM
Subscribers
None
from kafka import KafkaConsumer
import ssl
context = ssl.create_default_context()
context.check_hostname = False # have to be explicitly set to False
context.load_verify_locations("/etc/ssl/certs/ca-certificates.crt")
kconsumer = KafkaConsumer(
bootstrap_servers="kafka-main1002.eqiad.wmnet:9093",
security_protocol='SSL',
ssl_context=context
)