From 919e027d29b0bbcc0fd13abac18237d669f1e60e Mon Sep 17 00:00:00 2001 From: Pinga Date: Tue, 15 Jul 2025 15:02:56 +0300 Subject: [PATCH] Small update to make sure SSL check can be turned off --- epp/start_epp_test.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/epp/start_epp_test.php b/epp/start_epp_test.php index e9460df..34d47ea 100644 --- a/epp/start_epp_test.php +++ b/epp/start_epp_test.php @@ -267,18 +267,20 @@ $server->on('Receive', function(\Swoole\Server $serv, int $fd, int $reactorId, s $xmlString = $xml->asXML(); $trans = createTransaction($pdo, $clid, $clTRID, $xmlString); - $fingerprint = getClientFingerprint($serv, $fd); + if (!empty($c['mandatory_client_ssl'])) { + $fingerprint = getClientFingerprint($serv, $fd); - if (!$fingerprint) { - sendEppError($conn, $pdo, 2201, 'Client certificate authentication failed: no certificate provided', $clTRID); - return; - } + if (!$fingerprint) { + sendEppError($conn, $pdo, 2201, 'Client certificate authentication failed: no certificate provided', $clTRID); + return; + } - $storedFingerprint = getFingerprint($pdo, $clid); + $storedFingerprint = getFingerprint($pdo, $clid); - if (!$storedFingerprint || strcasecmp($fingerprint, $storedFingerprint) !== 0) { - sendEppError($conn, $pdo, 2201, 'Client certificate authentication failed: incorrect certificate', $clTRID); - return; + if (!$storedFingerprint || strcasecmp($fingerprint, $storedFingerprint) !== 0) { + sendEppError($conn, $pdo, 2201, 'Client certificate authentication failed: incorrect certificate', $clTRID); + return; + } } if (checkLogin($pdo, $clID, $pw)) {