cURL 错误 60:SSL:没有替代证书使用者名称与目标主机名匹配。项目间沟通

Mar*_*ark 2 drupal-7 drush drupal-8 ddev

所以我仍在使用 drush 和 ddev 将 Drupal 7 站点更新到 8。运行导入后,我收到了 update_d7_file 错误。我尝试使用本文安装证书: https://www.ddev.com/ddev-local/ddev-local-trusted-https-certificates/

但是仍然出现错误,有什么想法吗?

ddev exec drush migrate-import --all
ddev exec drush mmsg upgrade_d7_file

cURL error 60: SSL: no alternative certificate subject name matches target host name
'drupal7migration2.ddev.site'
(see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
(https://drupal7migration2.ddev.site//sites/default/files/Virtual%20Challenges%20%28Results%20and%2
0PBs%29%2020200709.xlsx)
Run Code Online (Sandbox Code Playgroud)

rfa*_*fay 6

当您希望一个 DDEV-Local 项目使用 https 与另一个项目通信时,客户端的curl 必须信任您正在通信的服务器端。有两种方法可以做到这一点:

  1. (内置,无需更改):使用ddev-<projectname>-web(容器名称)作为 URL 中的目标主机名。例如,在您的情况下,使用curl https://ddev-drupal7migration2-web. 该主机名已在各种 ddev 项目中受到信任。

  2. (需要 docker-compose.*.yaml):如果您想使用目标项目的真实完整 FQDN(在您的情况下为https://drupal7migration2.ddev.site),那么您需要将其添加为 external_link客户项目的.ddev。因此,在客户端(migration1?)项目中添加一个名为 .ddev/docker-compose.external_links.yaml 的文件,其中包含以下内容:

version: '3.6'
services:
  web:
    external_links:
    - "ddev-router:drupal7migration2.ddev.site"
Run Code Online (Sandbox Code Playgroud)

这将告诉 Docker 将“drupal7migration2.ddev.site”的请求路由到 ddev-router,并且您的容器和curl 信任它(它的证书列表中有该名称)。