diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/UserAgent.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/UserAgent.pm index 25a3cf1ed6e6021f6d9616c154560e181d836bed..e1d118e65f2fd2479cfdf2f41697464b69f035b8 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/UserAgent.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/UserAgent.pm @@ -7,11 +7,12 @@ use Lemonldap::NG::Common; our $VERSION = '2.18.0'; sub new { - my ( $class, $conf ) = @_; + my ( $class, $conf, $noproxy ) = @_; my $opts = $conf->{lwpOpts} || {}; my $agent = "LemonLDAP-NG/" . $Lemonldap::NG::Common::VERSION . " "; $opts->{agent} ||= $agent; - $opts->{ssl_opts} = $conf->{lwpSslOpts} if ( $conf->{lwpSslOpts} ); + $opts->{ssl_opts} = $conf->{lwpSslOpts} if ( $conf->{lwpSslOpts} ); + $opts->{env_proxy} = !$noproxy; my $ua = LWP::UserAgent->new(%$opts); push @{ $ua->requests_redirectable }, 'POST'; return $ua; diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/GitHub.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/GitHub.pm index 7b7ac149ddfea223941fbced4b70997ac5646b1e..6f7e416696ae1ae140c20ec99c1a1f6506fb2d3b 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/GitHub.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/GitHub.pm @@ -22,7 +22,6 @@ has ua => ( # TODO : LWP options to use a proxy for example my $ua = Lemonldap::NG::Common::UserAgent->new( $_[0]->{conf} ); - $ua->env_proxy(); return $ua; } ); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/LinkedIn.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/LinkedIn.pm index 10bbaaa364070ad313f71b9ba8950a9049725b92..bc3ff64314a0e6c6bb376e1ce02c4de6aea3fbbb 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/LinkedIn.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/LinkedIn.pm @@ -22,7 +22,6 @@ has ua => ( # TODO : LWP options to use a proxy for example my $ua = Lemonldap::NG::Common::UserAgent->new( $_[0]->{conf} ); - $ua->env_proxy(); return $ua; } ); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Twitter.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Twitter.pm index 72762e6494f18c0d7bc661075403c72c04a2285a..a0a19be4c4fa487959141815901121bbb60f4d15 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Twitter.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Twitter.pm @@ -47,7 +47,6 @@ has ua => ( # TODO : LWP options to use a proxy for example my $ua = Lemonldap::NG::Common::UserAgent->new( $_[0]->{conf} ); - $ua->env_proxy(); return $ua; } ); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm index 496ef406b29cf121db440aa0d71d29f1abf47069..523c22077656a72fa53686791c3f13fa13b2de17 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm @@ -21,7 +21,6 @@ has ua => ( # TODO : LWP options to use a proxy for example my $ua = Lemonldap::NG::Common::UserAgent->new( $_[0]->{conf} ); - $ua->env_proxy(); return $ua; } ); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenIDConnect.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenIDConnect.pm index ebc1913872bcf69e405e03d2a02c9eba85ba9a6a..1e9fbdc00ed0cffed9d0edeb2dbc31d06e4ffb70 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenIDConnect.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenIDConnect.pm @@ -101,7 +101,6 @@ has ua => ( lazy => 1, builder => sub { my $ua = Lemonldap::NG::Common::UserAgent->new( $_[0]->{conf} ); - $ua->env_proxy(); return $ua; } ); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SAML.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SAML.pm index d6f099b619830a283fe299f8ba49686afda3324c..7ffd4984824cbd278dbf36e4d07231bcf8f2e5ab 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SAML.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SAML.pm @@ -46,7 +46,6 @@ has ua => ( # TODO : LWP options to use a proxy for example my $ua = Lemonldap::NG::Common::UserAgent->new( $_[0]->{conf} ); - $ua->env_proxy(); return $ua; } ); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckDevOps.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckDevOps.pm index 97ab1d7dc20d8fb0c8a89c7e23c0512eeaf53445..e285829322979a9d5964150abfb56bbda8ba3162 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckDevOps.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckDevOps.pm @@ -41,7 +41,6 @@ has ua => ( lazy => 1, builder => sub { my $ua = Lemonldap::NG::Common::UserAgent->new( $_[0]->{conf} ); - $ua->env_proxy(); return $ua; } ); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CrowdSec.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CrowdSec.pm index 45efbfa2060d438feb1fabb43e91df6f13334aed..cf856cb188cca0ea8018f1400b0aa8076dca5a4a 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CrowdSec.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CrowdSec.pm @@ -24,7 +24,6 @@ has ua => ( # TODO : LWP options to use a proxy for example my $ua = Lemonldap::NG::Common::UserAgent->new( $_[0]->{conf} ); - $ua->env_proxy(); return $ua; } );