Importing a file from a server without a secure SSL certificate causes an error that stops the migration

Created on 26 July 2024, 9 months ago

Problem/Motivation

When importing an image from a server without an SSL security certificate or with errors in the certificate, an error occurs that stops the migration.

In CurlFactory.php line 211:
                                                                                                                                                
  cURL error 60: SSL: no alternative certificate subject name matches target host name 'myhost.com' (see https://curl.haxx.se/libcur  
  l/c/libcurl-errors.html) for https://myhost.com/route/to/file.jpeg

Steps to reproduce

I know this is a rather unusual use case and reproducing the error is tricky, in my case the error is occurring because the website from which the files are being imported is a Drupal 7 raised with DDEV, which caul adds an extra layer of complication.

Proposed resolution

The error occurs because \Drupal\migrate_file\Plugin\migrate\process\FileImport::sourceExists is not able to handle this exception. As a solution, a generic Guzzle catch can be added to the try of the method.

🐛 Bug report
Status

Needs review

Version

2.1

Component

Code

Created by

🇪🇸Spain enchufe Spain

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024