Azure-sdk-for-java: [BUG] Get Certificate for specific version not return policy property

Created on 23 Nov 2020  路  10Comments  路  Source: Azure/azure-sdk-for-java

Describe the bug
When I use RestApi or com.microsoft.azure:azure-keyvault SDK to get a certificate with a specific version, then the policy property won't return, but if I request without a specific version, then the policy property will return, is it by design? But I don't get the description from the document.
here is the RestApi result, SDK result is same.
image
image

Exception or Stack Trace
Return policy property when I get the specific version certification

the policy value in certificateBundle is null

Code Snippet
To Reproduce

com.microsoft.azure
azure-keyvault
1.2.4

CertificateBundle certificateBundle = keyVaultClient
                .getCertificate(vaultBaseUrl, certificateName, certVersion);
            if (certificateBundle == null) {
                throw new CertificateException(String.format("Cannot find certificate, certificate name is %s, "
                    + "url is %s, please check if the certificate exists.", certificateName, vaultBaseUrl));
            }

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [x] Bug Description Added
  • [x] Repro Steps Added
  • [x] Setup information Added
Client KeyVault Service Attention question

All 10 comments

@g2vinay @vcolin7 Can you help to check the problem?

Hi @zhoufenqin, thanks for creating this issue, I will look into it :)

Hi @zhoufenqin, thanks for creating this issue, I will look into it :)

Hi @vcolin7 thanks, Is it a bug? is so, we can temporarily solve the problem by getting the policy directly using keyVaultClient.getCertificatePolicy(vaultBaseUrl, certificateName) in our project, because we need to fix it ASAP, when you fix it, we can upgrade the SDK

Was this page helpful?
0 / 5 - 0 ratings