DDEV 项目使用 http 而不是 https 启动站点

noa*_*lyn 4 ddev

我在 MacBook 上运行 DDEV。DDEV 过去在https://projectname.ddev.site上交付项目,但现在仅启动http://projectname.ddev.site。我无法确切地说出这种变化是什么时候发生的。我知道“mkcert 可能无法正确安装...”的通知,我确实遵循了安装建议,但它没有改变。我该怎么做才能让 ddev 运行 https?

Starting testproject... 
mkcert may not be properly installed, we suggest installing it for trusted https support, `brew install mkcert nss`, `choco install -y mkcert`, etc. and then `mkcert -install` 
The hostname testproject.ddev.site is not currently resolvable, trying to add it to the hosts file 
ddev needs to add an entry to your hostfile.
It will require administrative privileges via the sudo command, so you may be required
to enter your password for sudo. ddev is about to issue the command: 
    sudo /usr/local/bin/ddev hostname testproject.ddev.site 127.0.0.1 
Please enter your password if prompted. 
Running   Command=sudo /usr/local/bin/ddev hostname testproject.ddev.site 127.0.0.1
Password:
Creating volume "testproject-mariadb" with default driver 
Building db 
Building web 
Creating ddev-testproject-db ... done
Creating ddev-testproject-dba ... done
Creating ddev-testproject-web ... done
 
Creating ddev-router ... done
 
Project type has no settings paths configured, so not creating settings file. 
Successfully started testproject 
Project can be reached at http://testproject.ddev.site http://127.0.0.1:32889 
kais-MBP:testproject kai$ ```



.ddev/config.yaml
```name: testproject
type: php
docroot: ""
php_version: "7.3"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.2"
mysql_version: ""
provider: default
use_dns_when_possible: true
composer_version: ""
Run Code Online (Sandbox Code Playgroud)

rfa*_*fay 12

您需要运行mkcert -install才能使 https 工作,ddev 会检测您是否已执行此操作。因此ddev poweroff,您应该会看到受信任mkcert -installddev starthttps URL。

如果这不起作用,请尝试使用ddev poweroff && mkcert -uninstall && sudo rm -rf "$(mkcert -CAROOT)" && mkcert -install- 完全删除 mkcert CA,这将完全卸载并重新安装 mkcert。