mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 09:22:03 +00:00
subscription updates: set UserAgent header on proxy connect request
This commit is contained in:
parent
af23db0ebf
commit
718427dacb
@ -4,6 +4,7 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use Digest::MD5 qw(md5_hex md5_base64);
|
use Digest::MD5 qw(md5_hex md5_base64);
|
||||||
use MIME::Base64;
|
use MIME::Base64;
|
||||||
|
use Net::SSL;
|
||||||
use HTTP::Request;
|
use HTTP::Request;
|
||||||
use LWP::UserAgent;
|
use LWP::UserAgent;
|
||||||
use JSON;
|
use JSON;
|
||||||
@ -231,6 +232,8 @@ sub check_subscription {
|
|||||||
local ($ENV{HTTPS_PROXY}, $ENV{HTTPS_PROXY_USERNAME}, $ENV{HTTPS_PROXY_PASSWORD});
|
local ($ENV{HTTPS_PROXY}, $ENV{HTTPS_PROXY_USERNAME}, $ENV{HTTPS_PROXY_PASSWORD});
|
||||||
|
|
||||||
if ($proxy) {
|
if ($proxy) {
|
||||||
|
# some proxies reject connection if UserAgent header is not set
|
||||||
|
Net::SSL::send_useragent_to_proxy(1);
|
||||||
($ENV{HTTPS_PROXY}, $ENV{HTTPS_PROXY_USERNAME}, $ENV{HTTPS_PROXY_PASSWORD}) =
|
($ENV{HTTPS_PROXY}, $ENV{HTTPS_PROXY_USERNAME}, $ENV{HTTPS_PROXY_PASSWORD}) =
|
||||||
PVE::API2Tools::parse_http_proxy($proxy);
|
PVE::API2Tools::parse_http_proxy($proxy);
|
||||||
$ua->proxy(['http'], $proxy);
|
$ua->proxy(['http'], $proxy);
|
||||||
|
Loading…
Reference in New Issue
Block a user