]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
subscription updates: set UserAgent header on proxy connect request
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 29 Oct 2013 09:20:38 +0000 (10:20 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 29 Oct 2013 09:20:38 +0000 (10:20 +0100)
PVE/API2/Subscription.pm

index 8ea874b26e3a634ce83bfdbaa79cd579be7f9aae..8817ad898a18251772bc5894fd99339ff5cc16a8 100644 (file)
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 use Digest::MD5 qw(md5_hex md5_base64);
 use MIME::Base64;
+use Net::SSL;
 use HTTP::Request;
 use LWP::UserAgent;
 use JSON; 
@@ -231,6 +232,8 @@ sub check_subscription {
     local ($ENV{HTTPS_PROXY}, $ENV{HTTPS_PROXY_USERNAME}, $ENV{HTTPS_PROXY_PASSWORD});
 
     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}) =
            PVE::API2Tools::parse_http_proxy($proxy);
        $ua->proxy(['http'], $proxy);