{"record":{"id":"1e11acf9e7753e08","repo":"appwrite/appwrite","slug":"this-transport-cannot-check-a-certificate-against-the","errorCode":null,"errorMessage":"This transport cannot check a certificate against the address {$name}. Give Tls a peerName the certificate carries, or ask for Verification::None.","messagePattern":"This transport cannot check a certificate against the address (.+?)\\. Give Tls a peerName the certificate carries, or ask for Verification::None\\.","errorType":"exception","errorClass":"ConnectionException","httpStatus":null,"severity":"error","filePath":"packages/smtp/src/Transport/Swoole.php","lineNumber":196,"sourceCode":"        return $settings;\n    }\n\n    /**\n     * Swoole checks the name with X509_check_host(), which reads the DNS entries\n     * of a certificate and not the address ones. Dialling an IP literal cannot\n     * pass however the certificate is written — the stream transport checks\n     * both — so saying so beats a handshake that fails with \"SSL verify failed\"\n     * and nothing else.\n     */\n    private function checkable(): void\n    {\n        $name = $this->options->peerName ?? $this->host;\n\n        if ($this->options->verify === Verification::None || filter_var($name, FILTER_VALIDATE_IP) === false) {\n            return;\n        }\n\n        throw new ConnectionException(\n            \"This transport cannot check a certificate against the address {$name}. Give Tls a \"\n            . 'peerName the certificate carries, or ask for Verification::None.',\n        );\n    }\n\n    /**\n     * The extension declares errCode and errMsg untyped, so neither can be\n     * dropped into a message without being looked at first.\n     */\n    private function error(Client $client): string\n    {\n        $code = $client->errCode;\n        $message = $client->errMsg;\n\n        return \\sprintf(\n            '[%d] %s',\n            \\is_int($code) ? $code : 0,\n            \\is_string($message) && $message !== '' ? $message : 'no reason given',","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/appwrite/appwrite/blob/7eab5f1970bacb06f8cce069c27b7d14a4178153/packages/smtp/src/Transport/Swoole.php#L178-L214","documentation":"The Swoole transport cannot perform hostname/certificate verification against an IP address (Swoole's TLS layer lacks the peer-name override). If TLS verification is requested and the name to check (peerName or host) is an IP, checkable() throws ConnectionException telling you to supply a peerName or disable verification.","triggerScenarios":"connect() or startTls() when options->verify is not Verification::None and (options->peerName ?? host) is an IP literal, e.g. smtp host configured as '10.0.0.5' or '127.0.0.1' with verification enabled.","commonSituations":"Docker/internal networks where the SMTP server is referenced by IP, service discovery returning IPs, or .env pointing _APP_SMTP_HOST at an IP while TLS verification stays on.","solutions":["Set the Tls options peerName to the hostname that appears in the server certificate's SAN/CN","Use the SMTP server's hostname instead of its IP in the connection config","If the link is internal/trusted and verification is intentionally skipped, set verify: Verification::None"],"exampleFix":"// before\nnew Client('10.0.0.5', 587, tls: new Tls(verify: Verification::Yes)); // host is an IP\n// after\nnew Client('10.0.0.5', 587, tls: new Tls(verify: Verification::Yes, peerName: 'smtp.example.com'));","handlingStrategy":"validation","validationCode":"if ($tls->verify !== Verification::None\n    && filter_var($options->peerName ?? $host, FILTER_VALIDATE_IP) !== false) {\n    // would throw: set peerName to a cert hostname or disable verification\n}","typeGuard":null,"tryCatchPattern":"try {\n    $client->connect($host, $port);\n} catch (ConnectionException $e) {\n    // inspect config: IP host without peerName; fix Tls options\n}","preventionTips":["Prefer hostnames over IPs in SMTP config","Set Tls peerName whenever you connect by IP","Only use Verification::None on trusted internal links","Check the peerName matches a SAN/CN on the server certificate"],"tags":["smtp","tls","swoole","security"],"backgroundTag":"invalid-config-value","analyzedSha":"7eab5f1970bacb06f8cce069c27b7d14a4178153","analyzedAt":"2026-09-23T00:38:38.905Z","contentChangedAt":"2026-09-23T00:38:38.905Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}