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

Missing ClientCertificates in configuration #255

Open
AdrianBorowiec opened this issue Sep 8, 2021 · 1 comment
Open

Missing ClientCertificates in configuration #255

AdrianBorowiec opened this issue Sep 8, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@AdrianBorowiec
Copy link

During execution of API call RestClient is missing ClientCertificates despite passing them in API client constructor as a Configuration object as in example below:

var certificate = new X509Certificate2("path", "password", X509KeyStorageFlags.UserKeySet);
var configuration = new Configuration
{
   ClientCertificates = new X509CertificateCollection(new X509Certificate[] { certificate }),
};

var client = new AddressesApi(configuration);

Fix for this is quite simple - at then end of auto-generated function "MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second)" new merged Configuration variable is missing ClientCertificates assignment, please add:

ClientCertificates = second.ClientCertificates ?? first.ClientCertificates

at the end of Configuration object initializer, this should fix the issue :)

@christianhelle christianhelle self-assigned this Sep 9, 2021
@christianhelle
Copy link
Owner

@AdrianBorowiec thanks for reporting this

I'll see what I can do

I don't generate the code myself and just 100% piggy back on top of code generators I support (AutoRest, NSwag, OpenAPI Generator, Swagger Codegen CLI). I also make sure that I use the latest version of mentioned code generators to mangling with the generated code would be hard (if not impossible) to maintain

@christianhelle christianhelle added the bug Something isn't working label Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants