Method importCertificate in azure-security-keyvault-certificates:4.0.0 fails with 405
See original GitHub issueHi,
I’m trying to upload pre-existing certificates to our key vault. I’ve successfully used the certificate creation flow, so I know I can communicate with the key vault. This seems like an underlying issue.
I have generated a certificate and saved it in a file called root.pem
. It’s formatted as follows to satisfy the requirements of ImportCertificateOptions
:
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
I call the import method as follows:
// SDK call
client.importCertificate(new ImportCertificateOptions("import", Objects.requireNonNull(Util.fileToByteArray("keys/root.pem"))));
// Util method
public static byte[] fileToByteArray(final String path) {
try {
return Files.readAllBytes(Path.of(path));
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
When I call this method, the call fails with:
com.azure.core.exception.HttpResponseException: Status code 405, “{“error”:{“code”:“MethodNotAllowed”,“message”:“HTTP POST not allowed”}}”
The call fails in the SDK class CertificateService
.
Information
SDK(s): com.azure:azure-security-keyvault-certificates:4.0.0 com.azure:azure-identity:1.0.3
JDK: openjdk 11.0.5 2019-10-15 OpenJDK Runtime Environment (build 11.0.5+10-post-Ubuntu-0ubuntu1.1) OpenJDK 64-Bit Server VM (build 11.0.5+10-post-Ubuntu-0ubuntu1.1, mixed mode, sharing)
OS: No LSB modules are available. Distributor ID: Ubuntu Description: Pop!_OS 19.10 Release: 19.10 Codename: eoan
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (6 by maintainers)
Thanks @vcolin7, I’m on vacation right now but I’ll see if I can get this to work once I’m back. I do think I have a working upload with a certificate generated using Java and bouncy castle. But this was a while ago so I have to refresh my memory and look at the code base to be sure.
Hi, we’re sending this friendly reminder because we haven’t heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don’t hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!