Symfony Panther - 如何在本地主机上保留 SSL?

Symfony Panther - How tu keep SSL on localhost?

我正在使用 Panther 测试我的 Symfony 5 应用程序。

我需要测试我的 Stripe 支付系统。我可以填写表单域,但是当我提交 Stripe 时给我一个错误:

(index):1 You may test your Stripe.js integration over HTTP. However, live Stripe.js integrations must use HTTPS.

确实,Panther 似乎不是在 HTTPS 中而是在 HTTP 中启动客户端。

我在本地安装了 Symfony SSL 证书(所以我可以访问 https://127.0.0.1:8000

但是Panther只会运行 http://127.0.0.1:9080(9080是panther启动测试时占用的端口)

我该如何解决这个问题? 我没有在文档 ( https://github.com/symfony/panther ) 中看到任何选项,也没有在这个主题上看到任何出路

这是我的代码:

$client = static::createPantherClient();
$client->request('GET', '/website/tarifs');

//fill the form and submit

Panther 的内部网络服务器仅使用 http(如您所见in the code). If you want to use SSL, you have to use your own webserver that handles the encryption layer. This works as documented:

    public function testMyApp(): void
    {
        $pantherClient = static::createPantherClient(['external_base_uri' => 'https://localhost']);
        // the PHP integrated web server will not be started
    }