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

[BUG] Problem importing a certificate #47636

Open
Courela opened this issue Dec 22, 2024 · 2 comments
Open

[BUG] Problem importing a certificate #47636

Courela opened this issue Dec 22, 2024 · 2 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. KeyVault needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@Courela
Copy link

Courela commented Dec 22, 2024

Library name and version

Azure.Security.KeyVault.Certificates 4.6.0

Describe the bug

Hello,
I'm using Azure SDK to import a certificate to KeyVault. I'm using a method called
Azure.Security.KeyVault.Certificates.ImportCertificate

In here I see a call to SendRequest that takes CertificatesPath and a slash (/) as parameters, but CertificatesPath already has a slash at the end

internal const string CertificatesPath = "/certificates/";

making the endpoint being called like
/certificates//someName/import
with two slashes between /certificates and /import

Expected behavior

I would expect that the called endpoint be
/certificates/someName/import

Actual behavior

Endpoint called
/certificates//someName/import

Reproduction Steps

Create a CertificateClient and call ImportCertificate

this.certificateClient.ImportCertificate(importOptions);

Environment

OS: Windows 10
IDE: Visual Studio 17.9.6

Using mcr.microsoft.com/dotnet/sdk:6.0-alpine docker image to compile and mcr.microsoft.com/dotnet/aspnet:6.0-alpine docker image to run the app.

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. KeyVault labels Dec 22, 2024
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@github-actions github-actions bot added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 22, 2024
@Courela
Copy link
Author

Courela commented Dec 23, 2024

I managed to compile the code and the CertificatesPath needs the ending slash for other methods, adding an extra slash in here

return _pipeline.SendRequest(RequestMethod.Post, importCertificateOptions, () => new KeyVaultCertificateWithPolicy(), cancellationToken, CertificatesPath, "/", importCertificateOptions.Name, "/import");

seems to be the problem.

It also happens here

return await _pipeline.SendRequestAsync(RequestMethod.Post, importCertificateOptions, () => new KeyVaultCertificateWithPolicy(), cancellationToken, CertificatesPath, "/", importCertificateOptions.Name, "/import").ConfigureAwait(false);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. KeyVault needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants