You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the production server (Set-PAServer LE_PROD) it fails with the following output:
VERBOSE: Updating directory info from https://acme-v02.api.letsencrypt.org/directory
VERBOSE: Using ACME Server https://acme-v02.api.letsencrypt.org/directory
VERBOSE: Using account 123456789
VERBOSE: Order name not specified, using '!.domain.com'
VERBOSE: Creating a new order '!.domain.com' for *.domain.com, domain.com
WARNING: Fewer Plugin values than names in the order. Using cPanel for the rest.
VERBOSE: Publishing challenge for Domain domain.com with Token OOgNpon0ASetYkoErO6lz2pXmLbydMqdieM5IfMQSxg using Plugin cPanel and DnsAlias ''.
Submit-ChallengeValidation : Cannot process argument transformation on parameter 'cPanelUsername'. Cannot convert the "domain" value of
type "System.String" to type "System.Collections.Hashtable".
At C:\Program Files\WindowsPowerShell\Modules\Posh-ACME\4.7.0\Public\New-PACertificate.ps1:231 char:9
Hi @tmr-cf, thanks for reaching out. Nice work on the plugin. There isn't any code difference between using Staging and Prod. So if it works with one, it should theoretically work with the other.
That said, there does seem to be some weirdness in your two helper functions, Find-CPZoneSerial and Find-CPZoneLine. They're specifying the $cPanelUsername as a [hashtable] instead of a [string] on lines 155 and 182 in the param block. I'm pretty sure that's the cause of the argument transformation error you saw if you're passing a string to them.
I'm wondering if your success in staging was due to a previously cached authorization or perhaps a previously loaded version of the plugin?
I have created a plugin for cPanel DNS (attached) and can successfully obtain a certificate from staging server (Set-PAServer LE_STAGE) using:
$certNames = '*.domain.com','domain.com'
$email = 'ict@domain.com'
$pArgs = @{cPanelUsername='domain'; cPanelAPITokin='JCBNMUWKVJ4D6D9TX9B8S76RPBUXAFRW'}
New-PACertificate $certNames -AcceptTOS -Contact $email -Plugin cPanel -PluginArgs $pArgs -Install -Force -Verbose
When using the production server (Set-PAServer LE_PROD) it fails with the following output:
VERBOSE: Updating directory info from https://acme-v02.api.letsencrypt.org/directory
VERBOSE: Using ACME Server https://acme-v02.api.letsencrypt.org/directory
VERBOSE: Using account 123456789
VERBOSE: Order name not specified, using '!.domain.com'
VERBOSE: Creating a new order '!.domain.com' for *.domain.com, domain.com
WARNING: Fewer Plugin values than names in the order. Using cPanel for the rest.
VERBOSE: Publishing challenge for Domain domain.com with Token OOgNpon0ASetYkoErO6lz2pXmLbydMqdieM5IfMQSxg using Plugin cPanel and DnsAlias ''.
Submit-ChallengeValidation : Cannot process argument transformation on parameter 'cPanelUsername'. Cannot convert the "domain" value of
type "System.String" to type "System.Collections.Hashtable".
At C:\Program Files\WindowsPowerShell\Modules\Posh-ACME\4.7.0\Public\New-PACertificate.ps1:231 char:9
Any help debugging would be very much appreciated.
cPanel.zip
The text was updated successfully, but these errors were encountered: