請(qǐng)問 http://wtbis.cn/doc/workerman/components/workerman-redis-queue.html
Redis隊(duì)列怎么加密連接 tls
[
'host' => 'redis://127.0.0.1:1234',
'options' => [
'auth' => 'testtest', // 密碼,可選參數(shù)
'db' => 2, // 數(shù)據(jù)庫(kù)
'max_attempts' => 5, // 消費(fèi)失敗后,重試次數(shù)
'retry_seconds' => 30, // 重試間隔,單位秒
]
]
我用了Redis7 Tls怎么都儲(chǔ)存不了數(shù)據(jù) 用阿里云的可以
已經(jīng)解決。
配置文件改成
[
'host' => 'redis://127.0.0.1:1234',
'options' => [
'auth' => 'testtest', // 密碼,可選參數(shù)
'db' => 2, // 數(shù)據(jù)庫(kù)
'max_attempts' => 5, // 消費(fèi)失敗后,重試次數(shù)
'retry_seconds' => 30, // 重試間隔,單位秒
'ssl' => 1, // 0關(guān)閉 1開啟
]
]
修改源碼 /vendor/workerman/redis/src/Client.php
在328行 $this->_connection = new AsyncTcpConnection($this->_address, $context); 后 添加
// 自行改造加密鏈接
if($this->_options['ssl'] === 1){
$this->_connection->transport = 'ssl';
}