Forum Discussion
Vincent_Li_9688
May 22, 2012Historic F5 Account
How to upload cert through Management :: KeyCertificate :: certificate_import_from_file
Hi ,
I adopted the Perl Certificate Info script https://devcentral.f5.com/wiki/iControl.PlCertificateInfo.ashx, and attempt to add new feature like uploading certificate to BIGIP according ...
Travis_Collavo_
Jul 19, 2012Historic F5 Account
PS - I've tried referencing the local file on my laptop as well as an uploaded copy in /var/tmp and /config/ssl/ssl.crt with no difference in the end result.
My code is as follows:
$KeyCertificate = &GetInterface("Management/KeyCertificate");
sub importCert()
{
my ($cert_id, $fileName) = (@_);
print "\nabout to attempt to import cert_id $cert_id, fileName $fileName\n";
$soap_response = $KeyCertificate->certificate_import_from_file
(
SOAP::Data->name(mode => "MANAGEMENT_MODE_DEFAULT"),
SOAP::Data->name(cert_ids => $cert_id),
SOAP::Data->name(file_names => $fileName),
SOAP::Data->name(overwrite => 1)
);
if ( $soap_response->fault )
{
print $soap_response->faultcode, " ", $soap_response->faultstring, "\n";
$success = 0;
}
else
{
$success = 1;
}
return $success
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects