Using Spaces with Laravel - cURL Error 60

I am attempting to connect to a Digital Ocean Space from a Laravel 8 webapp using PHP 8. Whenever I try to upload a file, I get this error:


Error executing "PutObject" on 
AWS HTTP error: cURL error 60: SSL: no alternative certificate subject name matches target 
host name '[MY-SPACE-NAME]' 
(see for 

Here is my config file:

'spaces' => [
    'driver' => 's3',
    'key' => env('SPACES_KEY'),
    'secret' => env('SPACES_SECRET'),
    'endpoint' => env('SPACES_ENDPOINT'),
    'region' => env('SPACES_REGION'),
    'bucket' => env('SPACES_BUCKET'),

… and my .env file:


If I add “https://” to the start of the endpoint, it seems to want to prefix the space name before the protocol, ending up with this: [MY-SPACE-NAME]., which obviously throws up another error (cURL error 1).

In the other threads I’ve seen relating to this issue, the suggested solution has been to either uppercase the region (which has no effect in this case) or add ‘https://’ to the endpoint, which doesn’t work either. Prefixing ‘https://’ to the space name yields the correct URL but the same error: cURL error 60. Usually this problem occurs on Windows-users’ local dev environments, so I can’t figure why this is happening in my case (both in my local dev environment on macOS and on a server running Ubuntu.

Some assistance would be most appreciated. Thanks.

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
March 23, 2021
Accepted Answer

Hi there,

I think that I’ve seen a similar problem here:

I believe that the error is occurring as you are not using https:// for your Spaces URL.

So you need to change http://** to https://**

For more information, I would recommend following the steps here on how to integrating an S3-Compatible Object Storage into your Laravel Application:—-integrating-an-s3-compatible-object-storage-into-the-application

Let me know how it goes! Regards, Bobby