Foreman-proxy uise wrong puppet cert command

Problem:
I am running foreman 3.2.1, the foreman server act as ENC for my puppet server.
The puppet CA is managed on the foreman server. When I go on the smart proxies page, then select the proxy, then Puppet CA tab I got an error :

Failure: ERF50-5345 [Foreman::WrappedException]: Unable to connect ([ProxyAPI::ProxyException]: ERF12-5356 [ProxyAPI::ProxyException]: Unable to get PuppetCA certificates ([RestClient::NotAcceptable]: 406 Not Acceptable) for proxy https://foremanserver.fr:8443/puppet/ca)

in the foreman-proxy logs I see it uses the wrong puppetca command :

2023-10-13T10:45:05 bbaed4d5 [I] Finished GET /puppet/ca/autosign with 200 (1.59 ms)
2023-10-13T10:45:05 68906aed [D] Found puppetca at /opt/puppetlabs/bin/puppet
2023-10-13T10:45:05 68906aed [D] Found sudo at /usr/bin/sudo
2023-10-13T10:45:05 68906aed [D] Executing /usr/bin/sudo -S /opt/puppetlabs/bin/puppet cert --ssldir /etc/puppetlabs/puppet/ssl --list --all
2023-10-13T10:45:05 68906aed [W] Failed to run puppetca:
2023-10-13T10:45:05 68906aed [E] Failed to list certificates: Execution of puppetca failed, check log files

When I use the command I got this output :

root@foremanserver:/etc/puppetlabs# /usr/bin/sudo -S /opt/puppetlabs/bin/puppet cert --ssldir /etc/puppetlabs/puppet/ssl --list --all
This command is no longer functional, please use `puppetserver ca` instead.

Expected outcome:
display certificat list without error

Foreman and Proxy versions:

ii  foreman                           3.2.1-2                                            amd64        Systems management web interface
ii  foreman-cli                       3.2.1-2                                            all          metapackage providing hammer CLI for Foreman
ii  foreman-debug                     3.2.1-2                                            all          provides support utility foreman-debug.
ii  foreman-installer                 3.2.1-1                                            all          Automated puppet-based installer for The Foreman
ii  foreman-postgresql                3.2.1-2                                            all          metapackage providing PostgreSQL dependencies for Foreman
ii  foreman-proxy                     3.2.1-1                                            all          RESTful proxies for DNS, DHCP, TFTP, and Puppet
ii  foreman-vmware                    3.2.1-2                                            all          metapackage providing vmware dependencies for Foreman
ii  ruby-hammer-cli-foreman           3.1.0-1                                            all          Foreman commands for Hammer

on foreman server puppetserver version :

ii puppetserver 6.20.0-1buster all Puppet Labs puppetserver

Foreman and Proxy plugin versions:

Distribution and version:
Debian 10

This is fixed with 3.4 switching to the API instead of CLI to manage the certificates.
So you need to update and while doing so I would recommend updating to a supported version which is currently 3.6 and 3.7, with 3.8 already being a release candidate.