Skip to content

Commit 58991c5

Browse files
Ashley McKemiedpkp
authored andcommitted
Add ssl_password to default_config dicts. Send ssl_password when loading cert chains (#750)
1 parent 455001d commit 58991c5

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

kafka/client_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class KafkaClient(object):
5959
'ssl_cafile': None,
6060
'ssl_certfile': None,
6161
'ssl_keyfile': None,
62+
'ssl_password': None,
6263
'ssl_crlfile': None,
6364
}
6465

kafka/conn.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class BrokerConnection(object):
7171
'ssl_certfile': None,
7272
'ssl_keyfile': None,
7373
'ssl_crlfile': None,
74+
'ssl_password': None,
7475
'api_version': (0, 8, 2), # default to most restrictive
7576
'state_change_callback': lambda conn: True,
7677
}
@@ -228,7 +229,8 @@ def _wrap_ssl(self):
228229
log.info('%s: Loading SSL Key from %s', str(self), self.config['ssl_keyfile'])
229230
self._ssl_context.load_cert_chain(
230231
certfile=self.config['ssl_certfile'],
231-
keyfile=self.config['ssl_keyfile'])
232+
keyfile=self.config['ssl_keyfile'],
233+
password=self.config['ssl_password'])
232234
if self.config['ssl_crlfile']:
233235
if not hasattr(ssl, 'VERIFY_CRL_CHECK_LEAF'):
234236
log.error('%s: No CRL support with this version of Python.'

kafka/consumer/group.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class KafkaConsumer(six.Iterator):
196196
'ssl_certfile': None,
197197
'ssl_keyfile': None,
198198
'ssl_crlfile': None,
199+
'ssl_password': None,
199200
'api_version': 'auto',
200201
'api_version_auto_timeout_ms': 2000,
201202
'connections_max_idle_ms': 9 * 60 * 1000, # not implemented yet

0 commit comments

Comments
 (0)