Brevo SMTP: STARTTLS certificate verify failed, how to fix it
The error means your server could not validate the TLS certificate that smtp-relay.brevo.com presented. The usual cause is a stale or missing CA bundle on your side, or a wrong connection mode. Update the CA bundle, use port 587 with STARTTLS, drop any ssl:// prefix, and test with openssl s_client.
Sohail Hussain8 min readShort answer
- The error means your server reached smtp-relay.brevo.com, started TLS, and then refused to trust the certificate it received. The cause is almost always on the sending machine, not at Brevo.
- Update the CA bundle on the machine that sends, then use host smtp-relay.brevo.com, port 587, STARTTLS, with no ssl:// prefix. If that fails, check for TLS interception and the system clock.
You are sending through Brevo SMTP and your mailer (often PHP, for example Symfony Mailer) throws this:
Unable to connect with STARTTLS ... error:0A000086:SSL routines::certificate verify failed
Don't switch certificate verification off to make it disappear. That hides the symptom and lets anyone on the network path read your SMTP key.
Why it happens
The client connected over plain TCP, sent STARTTLS, and the handshake then failed. error:0A000086 is the OpenSSL 3 code for "certificate verify failed". Your side does the verifying, so the usual causes are, most common first:
- Outdated or missing CA bundle. The client can't build a chain from Brevo's certificate to a root it trusts. This is common on old servers, minimal Docker images, and XAMPP or WAMP on Windows.
- PHP uses a different CA file than the system.
opensslon the command line works, but PHP points at a missing or stale file. - Wrong mode for the port. A
ssl://prefix or an implicit-TLS setting on a STARTTLS port. - TLS interception. A firewall, proxy or antivirus re-signs the traffic with a certificate your server doesn't trust.
- Wrong system clock. A valid certificate looks expired or not yet valid.
- Hostname mismatch. You connect under a name the certificate doesn't cover, such as an old Sendinblue hostname or a bare IP address.
I can't say which of these hits you without a test, and Brevo's documentation doesn't describe this exact error. The test below sorts it out in a minute.
Test the connection outside your app
Run this on the same server that sends mail. It removes your application from the picture.
openssl s_client -starttls smtp -connect smtp-relay.brevo.com:587 -servername smtp-relay.brevo.com -crlf
Scroll to the end of the output and read the Verify return code line.
| Result | Likely cause | Go to |
|---|---|---|
0 (ok) | System trust store is fine; app or PHP config is wrong | Fix 2 and Fix 3 |
20 or 21 (unable to get local issuer certificate) | CA bundle missing or old | Fix 1 |
10 (certificate has expired) while dates look current | System clock is wrong | Fix 5 |
62 (Hostname mismatch) | Connecting under the wrong name | Fix 3 |
| Issuer is a firewall, company or antivirus name | TLS interception | Fix 4 |
Step-by-step fixes
Fix 1: Update the CA bundle
- On Debian or Ubuntu, reinstall the package:
sudo apt-get update && sudo apt-get install --reinstall ca-certificates. - Refresh the store with
sudo update-ca-certificates. - On RHEL, Rocky, AlmaLinux or Fedora, run
sudo dnf update ca-certificates, thensudo update-ca-trust. - In Docker, rebuild the image from a current base instead of pinning an old one, and make sure
ca-certificatesis installed in it. - Run the
openssl s_clienttest again. You wantVerify return code: 0 (ok).
Fix 2: Point PHP at a current CA file
PHP does not always read the system store. If openssl s_client passes but PHP still fails, check which file PHP trusts.
- Check what PHP currently uses:
php -r "print_r(openssl_get_cert_locations());". - Check the ini values:
php -i | grep -i -E "openssl.cafile|curl.cainfo". - If
openssl.cafileis empty, or points to a missing or years-old file, download a currentcacert.pemfrom the cURL project's CA certificate extract page and save it somewhere permanent. - Open the php.ini that your web server uses (the CLI and PHP-FPM often load different files;
php --inishows the CLI one) and set:
openssl.cafile = "/etc/ssl/certs/cacert.pem"
curl.cainfo = "/etc/ssl/certs/cacert.pem"
- Restart PHP-FPM or Apache so the change loads.
This is the usual fix on XAMPP and WAMP, where no CA file is typically configured.
Fix 3: Use the right host, port and mode
Brevo's help center says it is recommended to start with port 587 as the default, and that for an encrypted connection with TLS encryption, you should use port 587. On the same page, Brevo says port 465 is the one for SSL encryption. That is why mixing modes fails: STARTTLS belongs on 587, implicit TLS on 465.
Brevo's manual setup instructions tell you to enter smtp-relay.brevo.com as the SMTP server, and its form-based setup says to leave the encryption field empty unless you're using port 465. That wording is for Brevo's own form. In PHP libraries and most mail plugins, choose STARTTLS (sometimes labeled "TLS") for 587 and follow your app's wording.
| Setting | Value |
|---|---|
| Host | smtp-relay.brevo.com |
| Port | 587 |
| Encryption | STARTTLS (sometimes labeled "TLS") |
| Host prefix | none; no ssl:// or tls:// |
| Username | your SMTP login from Settings > SMTP & API |
| Password | your SMTP key, not your account password |
In a Symfony-style DSN, smtp:// on port 587 negotiates STARTTLS:
smtp://{your-login}:{your-smtp-key}@smtp-relay.brevo.com:587
Brevo's troubleshooting article says your SMTP login is shown in the Login field under Settings > SMTP & API. It also warns that smtp-relay.brevo.com is the relay host, not a login. A wrong login produces a 535 authentication error after the TLS step, not this certificate error, but fix it in the same pass. Details are in Brevo's SMTP troubleshooting article.
If your host blocks 587, Brevo says port 2525 serves as a viable alternative; see Brevo's article Which SMTP port should I use?. If an old config still uses a Sendinblue hostname, replace it with smtp-relay.brevo.com, because the certificate is checked against the name you connect to.
Do not disable verification
Settings such as verify_peer=false appear in many forum answers. They make the error vanish but let anyone on the network path read your SMTP credentials. Fix the trust store instead.
Fix 4: Rule out TLS interception
If the issuer in the openssl s_client output names your company, a firewall, a proxy or a security product, that device is re-signing the traffic. Your server doesn't trust its root, so verification fails. This is common on corporate networks and on machines whose antivirus scans encrypted connections.
- Confirm the issuer in the certificate chain printed by
openssl s_client. - Ask whoever runs the network to exempt
smtp-relay.brevo.comfrom inspection, or - Add the inspecting device's root certificate to the server's trust store (and to PHP's
cacert.pemif PHP uses its own file).
Fix 5: Correct the system clock
- Run
date -uand compare it with real UTC time. - On systemd machines, enable time sync with
timedatectl set-ntp true. - Retest. Virtual machines restored from old snapshots are a frequent cause.
Checklist before you try again
openssl s_clientfrom the sending server showsVerify return code: 0 (ok).- PHP's
openssl.cafilepoints to an existing, recent file, and the right php.ini was edited. - PHP-FPM or Apache was restarted after the change.
- Host is
smtp-relay.brevo.com, port587, STARTTLS, nossl://prefix. - The server clock is correct and synced.
- No proxy or antivirus is re-signing outbound SMTP traffic.
If nothing works
Contact Brevo support only if openssl s_client also fails from a clean network, such as a different server or your laptop on home internet. If it passes elsewhere, the fault is in your environment; your hosting provider or network admin can help, and Brevo can't. Include the full s_client output, the exact time with timezone, your server's public IP, the port, and the steps you already tried.
Subject: TLS certificate verify failed on smtp-relay.brevo.com:587
Hello,
My server gets "Unable to connect with STARTTLS ... error:0A000086:SSL routines::certificate verify failed"
when connecting to smtp-relay.brevo.com on port 587.
Time of failure: {date, time, timezone}
Server public IP: {ip}
Command run: openssl s_client -starttls smtp -connect smtp-relay.brevo.com:587 -servername smtp-relay.brevo.com
Verify return code: {code from output}
Also tested from a different network: {yes/no, result}
Already tried: updated CA bundle, set openssl.cafile, confirmed no TLS inspection, checked clock.
Full s_client output is attached.
Common questions
Is the problem Brevo's certificate?
Rarely. If the same openssl s_client test passes from another server or network, the certificate is fine and your environment is the cause.
Can I just use port 465 instead?
Only if your client is set to implicit TLS (SSL) for that port. It doesn't skip certificate verification, so an outdated CA bundle or an intercepting proxy will break it too.
Why does it work on the command line but fail in my app?
The app likely uses a different CA file or php.ini than your shell. Check openssl.cafile for the web server's PHP, not just the CLI.
Where can I read more about STARTTLS versus implicit TLS?
Our explainer on SSL/TLS for email and SMTP encryption covers the difference, and the glossary has an entry on SMTP.
Explore: Email Deliverability
Related Articles
0x800ccc0e: Outlook Unable to Connect to SMTP Server, Fixed
Outlook error 0x800ccc0e means the app could not open a connection to your outgoing (SMTP) server. Usually the port, encryption setting or password is wrong, or antivirus, a firewall or your ISP is blocking it. Set port 587 with STARTTLS, turn on SMTP authentication, and test again.
SocketLabs "421 4.5.1 Too many errors" blacklist: how to fix it
`421 4.5.1 Too many errors, you have been temporarily blacklisted` means a SocketLabs server saw repeated auth or bad-address errors from your IP and paused it. Stop whatever is retrying, fix credentials and invalid recipients, clear the queue, and wait. The block usually lifts within minutes, but returns if retries resume.
421-4.7.0 Gmail Has Detected This Message Is Suspicious: Fix
The 421-4.7.0 "suspicious due to the nature of the content and/or the links" error means Gmail's content filter rejected your message after DATA, not an authentication check. Remove click tracking or move it to your own domain, drop URL shorteners, check link reputation, then retest with a plain message.
421 4.7.0 IP not in whitelist for RCPT domain: what it means
The error 421 4.7.0 IP not in whitelist for RCPT domain means the recipient's mail gateway, usually Mimecast in reports, only accepts connections from approved IPs, and the Google sending IP isn't on that list. The fix is on the recipient side: their admin must allow the IPs or change the mail routing.
Ready to supercharge your email marketing?
Start sending smarter emails with AI-powered campaigns. No credit card required.
Get Started Free