I've taken a look at the documentation and fired off a few API calls successfully, but the upload operation is a little different as it references data in a multipart request.
I'm using the v16.5 documentation because the v17 docs appear to be missing this particular page (it appears in the menu but the link is broken because the AddCertificate&UpdateCertificate.html file is missing).
User-Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-GB) WindowsPowerShell/5.1.16299.251
Content-Type: multipart/mixed; boundary=Certificate_File_Upload
Host: sophos:4444
Content-Length: 2712
Connection: Keep-Alive
Content-Disposition: attachment; filename="test.pfx"
Content-Type: application/x-pkcs12
--Certificate_File_Upload--
Tidying that up for readability the decoded XML in the URL is:
<Request>
<Login>
<Username>admin</Username>
<Password>MyPassword</Password>
</Login>
<Set operation="add">
<Certificate>
<Action>UploadCertificate</Action>
<Name>Test</Name>
<Password>PfxPassword</Password>
<CertificateFormat>pkcs12</CertificateFormat>
<CertificateFile>test.pfx</CertificateFile>
<PrivateKeyFile></PrivateKeyFile>
</Certificate>
</Set>
</Request>
Going by the documentation this means "Certificate could not be updated".
Andrew
This thread was automatically locked due to age.