Cannot overwrite existing certificate/key using iControl certificate/key import_from_pem calls
I have been testing importing SSL certificate or key from PEM using iControl calls https://devcentral.f5.com/wiki/iControl.Management__KeyCertificate__certificate_import_from_pem.ashx (and key_import_from_pem). The two calls accept a boolean overwrite parameter which supposedly should allow overwriting of existing certificate/key. But this doesn't seem to work, my test Perl script (the actual API call part) looks like this:
$soapResponse = $KeyCert->certificate_import_from_pem
(
SOAP::Data->name(mode => MANAGEMENT_MODE_DEFAULT),
SOAP::Data->name(cert_ids => [$sCert]),
SOAP::Data->name(pem_data => [$CertPEM]),
SOAP::Data->name(overwrite => 1)
);
I've also tried "true" instead of 1 for the overwrite parameter, neither works, I'm getting errors like this:
01020066:3: The requested Certificate File (/Common/test-cert.crt) already exists in partition Common.
My target is an F5 VM running BigIP v12.1.0, the script works fine when the cert/key didn't already exist on the F5.