From 7dcd3e55f4e2e5a37585bc8b07a9f0fcdc5f91bd Mon Sep 17 00:00:00 2001 From: IYUU Date: Thu, 30 Jan 2020 22:00:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0https=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Client/Transmission/TransmissionRPC.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/Client/Transmission/TransmissionRPC.php b/app/Client/Transmission/TransmissionRPC.php index 32a55d3..f15a2b1 100644 --- a/app/Client/Transmission/TransmissionRPC.php +++ b/app/Client/Transmission/TransmissionRPC.php @@ -107,11 +107,16 @@ class TransmissionRPC implements AbstractClientInterface * Default values for stream context * @var array */ - private $default_context_opts = array('http' => array( - 'user_agent' => self::HTTP_UA, - 'timeout' => '60', // Don't want to be too slow - 'ignore_errors' => true, // Leave the error parsing/handling to the code - ) + private $default_context_opts = array( + 'http' => array( + 'user_agent' => self::HTTP_UA, + 'timeout' => '60', // Don't want to be too slow + 'ignore_errors' => true, // Leave the error parsing/handling to the code + ), + "ssl"=>array( + "verify_peer"=>false, + "verify_peer_name"=>false, + ) ); /** @@ -714,10 +719,6 @@ class TransmissionRPC implements AbstractClientInterface // Setup authentication (if provided) if ($this->username && $this->password) { $contextopts['http']['header'] = sprintf("Authorization: Basic %s\r\n", base64_encode($this->username . ':' . $this->password)); - $contextopts['http']['ssl'] = array( - "verify_peer"=>false, - "verify_peer_name"=>false, - ); } if ($this->debug) {