Skip to content

GetCertificateVersionAsync throws an Argument Exceptions for the Version parameter #43441

@MohamedSherif

Description

@MohamedSherif

Library name and version

Azure.Security.KeyVault.Certificates 4.6.0

Describe the bug

The async method GetCertificateVersionAsync throws Argument Exception if the version parameter is empty and throws ArgumentNullException if the version parameter is null. This is not the expected behavior according to the documentation given to this method.
This caused service failure on our side. We used to call the method in the old deprecated library with string.Empty value for the version parameter to get The root certificate.

Expected behavior

It is expected that the method accepts null or empty value for the version parameter. It should throw the exceptions only in the case of the certificateName is null or empty.

Actual behavior

The method throws exception when we pass string.Empty as the value of version parameter.

Reproduction Steps

certificateClient.GetCertificateVersionAsync(certificateName, string.Empty, cancellationToken);

Environment

No response

Metadata

Metadata

Labels

ClientThis issue is related to a non-management packageKeyVaultcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

Status

Not Started

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions