confluentinc / confluentinc/confluent-kafka-python

Failed to load OpenSSL provider "legacy": error:07880025:common libcrypto routines::reason(524325)

Open
#1,596 4 comments 5 reactions 0 assignees View on GitHub
bug component:librdkafka investigate further
Dominant language
Python
Stars
509
Forks
964
Avg merge
2d 2h
Merged PRs (30d)
14

Description

Description
===========
I tried to create Kafka producer and got some exceptions.
Firstly I didn't use 'ssl.providers': 'default,legacy' in kafka_config and got:
```cimpl.KafkaException: KafkaError{code=_INVALID_ARG,val=-186,str="Failed to create producer: Failed to parse ssl.keystore.location PKCS#12 file: C:\tools\kafka-keystore.p12: error:0308010C:digital envelope routines::unsupported: Global default library context, Algorithm (RC2-40-CBC : 0), Properties ()"}```
After I read some posts, added 'ssl.providers' to config and got:
```
%3|1687798306.488|SSL|kafka-003#producer-1| [thrd:app]: error:12800067:DSO support routines::could not load the shared library: filename(C:\semaphore-agent\vcpkg\packages\openssl_x64-windows\bin\legacy.dll)
%3|1687798306.488|SSL|kafka-003#producer-1| [thrd:app]: error:12800067:DSO support routines::could not load the shared library
Traceback (most recent call last):
File "C:\Projects\Kafka\kfk.py", line 32, in
producer = Producer(kafka_config)
cimpl.KafkaException: KafkaError{code=_INVALID_ARG,val=-186,str="Failed to create producer: Failed to load OpenSSL provider "legacy": error:07880025:common libcrypto routines::reason(524325): name=legacy"}
```
Windows explorer can't find folder _C:\semaphore-agent_. And I don't know why it use this path.
What can I do to fix and run it?

How to reproduce
================
```
kafka_config = {
'acks': 1,
'bootstrap.servers': servers,
'client.id': socket.gethostname(),
'ssl.keystore.location': 'C:\\tools\\kafka-keystore.p12',
'ssl.keystore.password': '12345',
'ssl.key.password': '12345',
'security.protocol': 'SSL',
'ssl.providers': 'default,legacy'
}
producer = Producer(kafka_config)
```

Checklist
=========
- confluent-kafka-python '2.1.1', 33620224 and librdkafka 2.1.1', 33620479
- Apache Kafka broker version: 2.4.1
- Operating system: Windows 10 x64
- [ ] Provide client logs (with `'debug': '..'` as necessary)
- [ ] Provide broker log excerpts
- [ ] Critical issue

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.