Skip to content

Commit

Permalink
test: fix the HTTPS over proxy test
Browse files Browse the repository at this point in the history
The test was failing when libwww-perl really support HTTPS over proxy.
See: libwww-perl/libwww-perl#52
  • Loading branch information
goneri authored and Gonéri Le Bouder committed Dec 25, 2013
1 parent 4fab178 commit fe68a18
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions t/agent/http/client/connection.t
Expand Up @@ -246,11 +246,20 @@ $server = FusionInventory::Test::Server->new(
);
$server->set_dispatch({
'/public' => sub {
return $ok->(@_) if $ENV{HTTP_X_FORWARDED_FOR};
if ($ENV{HTTP_X_FORWARDED_FOR}) {
diag("We are are supposed to do HTTPS over a proxy and ".
"HTTP_X_FORWARDED_FOR environment variables is defined. ".
"This should not append since the proxy cannot access the ".
"encrypted data. ".
"This means the local LWP library doesn't provide real ".
"SSL proxy support and try to contact the server using ".
"plaintext HTTP. HTTPS over proxy will not work properly. ".
"Please see: https://github.com/libwww-perl/libwww-perl/pull/52")
}
return $ok->(@_);
},
'/private' => sub {
return $ok->(@_) if $ENV{HTTP_X_FORWARDED_FOR} &&
$server->authenticate();
return $ok->(@_) if $server->authenticate();
}
});
eval {
Expand Down

0 comments on commit fe68a18

Please sign in to comment.