Symfony Panther – How tu keep SSL on localhost?

I am using Panther to test my Symfony 5 application.

I need to test my Stripe payment system. I can fill out the form fields, but when I submit Stripe gives me an error:

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

Indeed, it seems that Panther does not launch the client in HTTPS but in HTTP.

I installed the Symfony SSL certificate locally (so I can access https://127.0.0.1:8000)

But Panther will just run http://127.0.0.1:9080 (9080 is the port occuped by panther when launching tests)

How could I fix this? I did not see any option in the doc ( https://github.com/symfony/panther ), nor any way out on this subject

This is my code :

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

//fill the form and submit

enter image description here

Answer

The internal webserver of Panther uses http only (as you can see 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
    }