Quote:
Originally Posted by newperluser
Hi Jeff,
Thanks for your reply,
But even after trying out your code My code is not picking the passphrase from the file It stil prompts me for the passphrase
-
-
open(CFGFILE, "<../phrase.cfg");
-
while (<CFGFILE>)
-
{
-
($key,$value)=split(/\s+/,$_);
-
$config{$key}=$value;
-
}
-
#My client code , following which it will prompt for passphrase
-
system("../client -cert ../pfx.pem -host $ip_address -port $port -verbose -batch 1 >./tls/$ip_address/clientcerttest.log 2>&1");
-
-
$config{sslPass};
-
#close(CFGFILE) or die "Could not close file";
-
Can u pls point out whr im going wrong?
Well, the first thing you need to do is to please learn to use the code tags that are required to surround code you post in the forums. You can read about it
here.
Unfortunately, seeing as how I didn't have any code before, I can now see what is going on and what I gave you isn't going to work. The reason: you are running a system command that is going to prompt for information. One of the few ways to plan for that event is to use something like expect. There is an
Expect module in Perl, but it is quite complicated and not very easy to understand, especially if you don't know what
expect is.
I guess my only question would be, is does the client you are using have an option that can be added to provide the passphrase at execution? If so, you can add it and put in the variable sequence as the pass phrase and it would be interpolated into its value. That would be the only option I see, but I don't know how the client is coded and what it is using.
If the client is written wholly in Perl, then this might be an opportunity for you to extend it to accept a pass phrase, but again, I don't know what the code is using to do all of this.
Regards,
Jeff