Просмотр исходного кода

#4104 sys_curl_ssl_allow_untrusted option isn't applied in S3 storage classes

Alex Trofimov 3 лет назад
Родитель
Сommit
a9843c6ee1
2 измененных файлов с 4 добавлено и 0 удалено
  1. 2 0
      inc/classes/BxDolStorageS3.php
  2. 2 0
      inc/classes/BxDolStorageS3v4.php

+ 2 - 0
inc/classes/BxDolStorageS3.php

@@ -49,6 +49,8 @@ class BxDolStorageS3 extends BxDolStorage
             $this->_bSSL, 
             $this->_sEndpoint ? $this->_sEndpoint : 's3.amazonaws.com'
         );
+        if ($this->_bSSL && getParam('sys_curl_ssl_allow_untrusted'))
+             $this->_s3->setSSL($this->_bSSL, false);
     }
 
     /**

+ 2 - 0
inc/classes/BxDolStorageS3v4.php

@@ -24,6 +24,8 @@ class BxDolStorageS3v4 extends BxDolStorageS3
             $this->_sEndpoint ? $this->_sEndpoint : 's3.amazonaws.com',
             getParam('sys_storage_s3_region')
         );
+        if ($this->_bSSL && getParam('sys_curl_ssl_allow_untrusted'))
+             $this->_s3->setSSL($this->_bSSL, false);
     }
 }