So I am trying to upload an image to DO’s spaces, it gives me this error
“https://bucketName.bucketName.nyc3.digitaloceanspaces.com/ragbag/generatedImageName.jpg”; AWS HTTP error: cURL error 60: SSL: no alternative certificate subject name matches target host name ‘bucketName.bucketName.nyc3.digitaloceanspaces.com’ (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://bucketName.bucketName.nyc3.digitaloceanspaces.com/ragbag/generatedImageName.jpg
This is my laravel code
public function uploadImage2(Request $request)
{
$file = $request->file('image');
$storage = Storage::disk('spaces')->putFile('ragbag', $file);
and the file system config setup
'spaces' => [
'driver' => 's3',
'key' => env('DO_SPACES_KEY'),
'secret' => env('DO_SPACES_SECRET'),
'endpoint' => env('DO_SPACES_ENDPOINT'),
'region' => env('DO_SPACES_REGION'),
'bucket' => env('DO_SPACES_BUCKET'),
'throw' => true,
]
In the DO’s bucket storage configs, I set the Restrict File Listing to Restrict File Listing, CDN is disabled.
cURL 60 means The remote server’s SSL certificate or SSH fingerprint was deemed not OK. This error code has been unified with CURLE_SSL_CACERT since 7.62.0. Its previous value was 51.
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!
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.
Hey!
As far as I can see in the error that you’ve shared, the bucket name is prepended to the URL 2 times which is the problem:
Your settings should look as follows:
If you define your
DO_SPACES_ENDPOINT
endpoint as:https://bucketName.nyc3.digitaloceanspaces.com
it will also prepend the bucket name one more time causing the issue.Let me know if this is the case!
Best,
Bobby