Sean_Powell
Apr 07, 2016Nimbostratus
Can't Import SSL Certificate Bundle and Key with iControl via PowerShell
Hi,
I'm trying to automate the CSR and SSL Certificate import processes via iControl with Powrshell. I can generate and export the CSR/Key without issue, and I can import a Key/single certificate without issue using the following code:
$key_pem = get-content $key_path -raw;
$crt_pem = get-content $cert_path -raw;
(Get-F5.iControl).ManagementKeyCertificate.Key_import_from_pem("MANAGEMENT_MODE_DEFAULT",$url,$key_pem,1);
(Get-F5.iControl).ManagementKeyCertificate.certificate_import_from_pem("MANAGEMENT_MODE_DEFAULT",$url,$crt_pem,1);
However, the code fails and I get a 'Keys do not match' error when I try to import the certificate when it's bundled with the intermediate and root certificates. The import process works fine using the Admin UI, so I am guessing iControl isn't properly matching the certificate in the bundle with the key.
Can anyone give me an idea how to work around this?
Thanks!