From 307c0a9eae20e22d682b1805f05c0086d9f9ee1c Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Mon, 18 Oct 2010 01:04:48 -0400 Subject: [PATCH] remove more environment variables from Client.pm, for a more flexible programmatic interface --- Crypt/Monkeysphere/MSVA/Client.pm | 9 ++++++--- msva-query-agent | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Crypt/Monkeysphere/MSVA/Client.pm b/Crypt/Monkeysphere/MSVA/Client.pm index 820266d..0d91aad 100644 --- a/Crypt/Monkeysphere/MSVA/Client.pm +++ b/Crypt/Monkeysphere/MSVA/Client.pm @@ -46,14 +46,16 @@ my $peer = shift; my $pkctype = shift; my $pkcdata = shift; + my $msvasocket = shift; + + if (! defined $msvasocket or $msvasocket eq '') { + $msvasocket = 'http://localhost:8901'; + } my $apd = create_apd($context, $peer, $pkctype, $pkcdata); my $apdjson = to_json($apd); - # get msva socket from environment - my $msvasocket = $ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET}; - # create the user agent my $ua = LWP::UserAgent->new; @@ -73,6 +75,7 @@ $apdjson, ); + msvalog('debug', "Contacting MSVA at %s\n", $requesturl); my $response = $ua->request($request); my $status = $response->status_line; diff --git a/msva-query-agent b/msva-query-agent index 8dfd192..846d27d 100755 --- a/msva-query-agent +++ b/msva-query-agent @@ -32,7 +32,7 @@ my $pkcdata = do { ; }; -my ($status,$ret) = Crypt::Monkeysphere::MSVA::Client->query_agent($context,$peer,$pkctype, $pkcdata); +my ($status,$ret) = Crypt::Monkeysphere::MSVA::Client->query_agent($context,$peer,$pkctype, $pkcdata, $ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET}); msvalog('info', "status: %s\n", $status); msvalog('info', "valid: %s\n", $ret->{valid}); -- 2.26.2