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

问题描述 投票:0回答:1

所以我仍在使用 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)
drupal-7 drupal-8 drush ddev
1个回答
7
投票

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

  1. (内置,无需更改):使用

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

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

services:
  web:
    external_links:
    - "ddev-router:drupal7migration2.ddev.site"

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

有关此主题的 DDEV 常见问题解答中有更详细的介绍。

© www.soinside.com 2019 - 2024. All rights reserved.