Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CachedSchemaRegistryClient not Disposing X509Certificate2 #2187

Open
2 of 8 tasks
bryantlikes opened this issue Feb 6, 2024 · 0 comments
Open
2 of 8 tasks

CachedSchemaRegistryClient not Disposing X509Certificate2 #2187

bryantlikes opened this issue Feb 6, 2024 · 0 comments

Comments

@bryantlikes
Copy link

Description

The CachedSchemaRegistryClient is creating certificates but not disposing them. This causes the temp files created at %APPDATA%\Roaming\Microsoft\Crypto\RSA to not be deleted.

Nuget version 2.3

How to reproduce

You'll need a pfx file. For this code the pfx file has no password.

using Confluent.SchemaRegistry;

var config = new SchemaRegistryConfig
{
    Url = "https://anything.com",
    SslKeystoreLocation = "[path to your pfx file]"
};

var x = new CachedSchemaRegistryClient(config);

x.Dispose();

Now check that file location and you'll see a guid file there. Each time you run it will add a new one. If you Dispose (or Reset) the certificate that file gets cleaned up.

Not sure of the best solution but one option would be in the RestClient to add the passed in certificates to a local variable. Then on Dispose for that client loop through the certificates and dispose them as well.

Checklist

Please provide the following information:

  • A complete (i.e. we can run it), minimal program demonstrating the problem. No need to supply a project file.
  • Confluent.Kafka nuget version.
  • Apache Kafka version.
  • Client configuration.
  • Operating system.
  • Provide logs (with "debug" : "..." as necessary in configuration).
  • Provide broker log excerpts.
  • Critical issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant