Forum Discussion

Franz-Joseph_Kr's avatar
Franz-Joseph_Kr
Icon for Nimbostratus rankNimbostratus
Jun 22, 2006

Interfaces for ProfileClientSSL and ProfileServerSSL

Hello,

 

I am trying to manipulate the certificates and keys for the ProfileClientssl's and ProfileServerSSL's via set_certificate_file and set_key_file. But somehow it's not working properly. With this code I do not get any error messages, but the key-file is not updated either.

 

Can anybody give me a short hint??

 

 

my $sHost = shift @ARGV;
my $sPort = shift @ARGV;
my $sUID =  shift @ARGV;
my $sPWD =  shift @ARGV;
my $sName   = shift @ARGV;
my $sKey  = shift @ARGV;
my $sProtocol = "https";
        SOAP::Transport::HTTP::Client::get_basic_credentials($aUID, $aPWD);
        sub SOAP::Transport::HTTP::Client::get_basic_credentials
        {
                my $uid_ref = shift;
                my $pwd_ref = shift;
                return "$uid_ref" => "$pwd_ref";
        }
if ( ("80" eq $sPort) or ("8080" eq $sPort) )
        {
                $sProtocol = "http";
        }
my $ProfileCreate = SOAP::Lite
        -> uri('urn:iControl:LocalLB/ProfileServerSSL')
        -> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");
eval { $ProfileCreate->transport->http_request->header
(
        'Authorization' =>
                'Basic ' . MIME::Base64::encode("$sUID:$sPWD", '')
); };
 ---------------- idev -------
my $sFlag = "1";
my $attribute = { value => $sValue , default_flag => $sFlag };
my $soapResponse = $ProfileCreate->set_key_file(
          SOAP::Data->name( profile_names => [$sName]),
          SOAP::Data->name( keys   => [$attribute])
    );
    &checkResponse($soapResponse);
    print "Server SSL Profile $sName Created !\n";
        SUCCESS;
}
----------------------------------------------------------------------------
 checkResponse
----------------------------------------------------------------------------
sub checkResponse()
{
        my ($soapResponse) = (@_);
        if ( $soapResponse->fault )
        {
          print $soapResponse->faultcode, " ", $soapResponse->faultstring, "\n";
                exit();
        }
}

 

 

2 Replies

  • The first thing that sticks out for me is that you do not set the $sValue variable to anything before using it in your $attribute structure. So, the call is being made with a value of null and flag of 1 which doesn't make much sense.

     

     

    Try assigning the key file name to the sValue variable and see if that fixes things up.

     

     

    -Joe
  • Hi Joe,

     

     

    I assigned a value to $sValue e.g. ("zgafsai.muc.key"), but still it s not working. At least I should get an exception.

     

     

    Francis