Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rhand's avatar
Level 6

Spatie Backup failure SSL: no alternative certificate subject name matches target host name

Seems we have issue connecting to Digital Ocean Spaces for backups but only for staging. An error we have not had before. We did block access main staging site for non logged in users to avoid duplicate content competing with live site so could be the issue.

Here is the error code backing up using Spatie Backup ( https://github.com/spatie/laravel-backup ):

Whoops!

Important: An error occurred while backing
up site Staging (staging)

Exception message: Could not connect to
disk do_backup because:
GuzzleHttp\Exception\RequestException:
cURL error 60: SSL: no alternative certificate subject name matches target host name
'app.ams3.digitaloceanspaces.com'
(see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
for https://app.ams3.digitaloceanspaces.com/?list-type=2&prefix=site%20Staging%2F&delimiter=%2F in
 /home/ploi/staging.site.com/releases/37/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:211 Stack trace: 
#0 /home/ploi/staging.site.com/releases/37/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(158): GuzzleHttp\Handler\CurlFactory::createRejection() 
...
```

Any idea on how to use authentication for main frontend of staging and allow backups to pass through? That seems to be the cause here I mean. But not sure yet.
0 likes
3 replies
LaryAI's avatar
Level 58

The error message you're seeing is related to SSL certificate validation. It seems like the SSL certificate of the server you're trying to connect to (app.ams3.digitaloceanspaces.com) doesn't match the hostname.

This could be due to a misconfiguration on the server side, or it could be that your application is not correctly configured to connect to the server.

Here are a few things you can try:

  1. Check the SSL certificate of the server you're trying to connect to. You can do this by visiting the URL in a web browser and inspecting the certificate. Make sure the certificate is valid and the hostname matches.

  2. If you're using a self-signed certificate, you might need to add it to your application's trusted certificates. You can do this by adding the certificate to your PHP configuration.

  3. If you're using Guzzle (which it seems like you are, based on the error message), you can disable SSL certificate verification. This is generally not recommended for production environments, as it can make your application vulnerable to man-in-the-middle attacks. However, it can be useful for debugging purposes. Here's how you can do it:

$client = new \GuzzleHttp\Client(['verify' => false]);
  1. If none of the above solutions work, you might want to reach out to DigitalOcean support. They might be able to provide more insight into the issue.

Remember, disabling SSL verification should only be used for debugging and should never be used in a production environment. It's important to fix the underlying issue with the SSL certificate.

ndeblauw's avatar

Hi there,

Strangely I had exactly the same error last night on a forge provisioned server (but trying to connect to a linode s3 disk)... Coincidence?

I don't have time to look into things today, but maybe it's related to the certificate. I once had a similar issue on a local development machine. I have written out the solution for Laragon in this article https://devdojo.com/bluepundit/that-curl-error-when-using-http-client-laravel

If you manage, please keep us updated on how you solve this issue?

1 like
rhand's avatar
rhand
OP
Best Answer
Level 6

@ndeblauw backups for staging are now working again so do think it was a certificate issue with Digital Oceaan Spaces. Thought it was an issue on my side with authentication blocking things, but realized that was not possible.

I did not contact DO Spaces as I decided to wait one more day. And then this morning I saw all backups passed with flying colors. So I have not really debugged, but based on error report, reply by @laryai and Curl documentation check I think it was a temporary issue on the Digital Ocean Spaces side. And perhaps only for my bucket as no one else complained about similar issues.

Please or to participate in this conversation.