当我尝试使用kafka-python从其他服务器连接到kafka时。我收到SSL认证错误。
ssl_certfile ='〜/ cacerts.pem',ssl_password ='~~~~',sasl_mechanism ='GSSAPI',sasl_kerberos_service_name ='ssskafka') 追溯(最近一次通话): self._sslobj.do_handshake() 在do_handshake中,文件“ /opt/middleware/anaconda_python/3.5.4/lib/python3.5/ssl.py”,第641行 self._sslobj.do_handshake() ssl.SSLError:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:719)
有人可以帮助解决该问题吗?
import ssl
import gssapi
from kafka import KafkaProducer, KafkaConsumer
consumer = KafkaConsumer(
bootstrap_servers='AAA:9094,BBBB:9094,CCC:9094',
security_protocol="SASL_SSL",
ssl_certfile='~/cacerts.pem',
ssl_password='~~~~',
sasl_mechanism='GSSAPI',
sasl_kerberos_service_name='ssskafka'
)