]> git.proxmox.com Git - pve-access-control.git/commitdiff
fix #916: allow HTTPS to access custom yubico url
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 14 Mar 2016 10:25:02 +0000 (11:25 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 14 Mar 2016 10:38:39 +0000 (11:38 +0100)
remove the limit to HTTP only, since it would only apply for
custom yubico validation server urls anyway.

PVE/AccessControl.pm

index b42797b40b5bec15a6113a6c2f9afef62b0397af..550fa87c24d23cb606c7760ac867fcf761801c8c 100644 (file)
@@ -1199,8 +1199,6 @@ sub yubico_verify_otp {
 
     die "yubico: wrong OTP lenght\n" if (length($otp) < 32) || (length($otp) > 48);
 
 
     die "yubico: wrong OTP lenght\n" if (length($otp) < 32) || (length($otp) > 48);
 
-    # we always use http, because https cert verification always make problem, and
-    # some proxies does not work with https.
 
     $url = 'http://api2.yubico.com/wsapi/2.0/verify' if !defined($url);
 
 
     $url = 'http://api2.yubico.com/wsapi/2.0/verify' if !defined($url);
 
@@ -1217,10 +1215,10 @@ sub yubico_verify_otp {
 
     my $req = HTTP::Request->new('GET' => "$url?$paramstr");
 
 
     my $req = HTTP::Request->new('GET' => "$url?$paramstr");
 
-    my $ua = LWP::UserAgent->new(protocols_allowed => ['http'], timeout => 30);
+    my $ua = LWP::UserAgent->new(protocols_allowed => ['http', 'https'], timeout => 30);
 
     if ($proxy) {
 
     if ($proxy) {
-       $ua->proxy(['http'], $proxy);
+       $ua->proxy(['http', 'https'], $proxy);
     } else {
        $ua->env_proxy;
     }
     } else {
        $ua->env_proxy;
     }