Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

LWP::UserAgent and Passphrase protected Certificates

by Sifmole (Chaplain)
on Aug 25, 2005 at 17:40 UTC ( #486661=perlquestion: print w/replies, xml ) Need Help??

Sifmole has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I am attempting to get LWP::UserAgent to properly handly a connection which requires a protected certificate. My current issue is that no matter which way I have tried to define the callback via any of the following:
set_default_passwd_cb CTX_set_default_passwd_cb $IO::Socket::SSL::SSL::GLOBAL_CONTEXT_ARGS{'SSL_passwd_cb'} &IO::Socket::SSL::context_init('SSL_passwd_cb' => \&foo );
The LWP::UserAgent either asks via the TTY for the passphrase or barges ahead not asking for one but not succeeding in making the connection. Anybody ever managed to use this feature?

Replies are listed 'Best First'.
Re: LWP::UserAgent and Passphrase protected Certificates
by tphyahoo (Vicar) on Aug 25, 2005 at 18:21 UTC
    I don't know if this will work or not, but you might want to try this with WWW::Mechanize (a subclass of LWP::UserAgent). Mechanize has a lot of features that make a variety of things easier, maybe it'll help with your problem.

    Also, when you google around for solutions, you might want to search on mechanize as well as UserAgent, because a lot of LWPers use the fancier mechanize module.

Re: LWP::UserAgent and Passphrase protected Certificates
by PodMaster (Abbot) on Aug 25, 2005 at 22:43 UTC
Re: LWP::UserAgent and Passphrase protected Certificates
by hookbot (Acolyte) on Jun 06, 2020 at 13:51 UTC

    On the new version of IO::Socket::SSL, it should work like this:

    IO::Socket::SSL::set_defaults(passwd_cb => sub { "SecretPassPhrase" });

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://486661]
Approved by sgifford
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2020-11-24 13:02 GMT
Find Nodes?
    Voting Booth?

    No recent polls found