From 5c7159ae43087a17adb8aa50d88cb41c2aeec120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Mon, 10 Nov 2025 23:22:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/deploy/ssh.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/lib/deploy/ssh.php b/app/lib/deploy/ssh.php index a67c1ee..75e552e 100644 --- a/app/lib/deploy/ssh.php +++ b/app/lib/deploy/ssh.php @@ -50,7 +50,8 @@ class ssh implements DeployInterface fclose($stream); $this->log('私钥已保存到:' . $config['pem_key_file']); } elseif ($config['format'] == 'pfx') { - $pfx = CertHelper::getPfx($fullchain, $privatekey, $config['pfx_pass'] ? $config['pfx_pass'] : null); + $pfx_pass = $config['pfx_pass'] ?: null; + $pfx = CertHelper::getPfx($fullchain, $privatekey, $pfx_pass); $stream = fopen("ssh2.sftp://$sftp{$config['pfx_file']}", 'w'); if (!$stream) { @@ -158,7 +159,7 @@ class ssh implements DeployInterface file_put_contents($privateKeyPath, $this->config['privatekey']); file_put_contents($publicKeyPath, $publicKey); umask($umask); - $passphrase = $this->config['passphrase'] ?? null; // 私钥密码 + $passphrase = $this->config['passphrase'] ?: null; // 私钥密码 if (!ssh2_auth_pubkey_file($connection, $this->config['username'], $publicKeyPath, $privateKeyPath, $passphrase)) { throw new Exception('私钥认证失败'); }