Skip to content

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

@Killen911

Description

@Killen911

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 <module>
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugReporting an unexpected or problematic behavior of the codebasecomponent:librdkafkaFor issues tied to the librdkfka elementsinvestigate furtherIt's unclear what the issue is at this time but there is enough interest to look into it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions