Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cPanel plugin works for LE_STAGE but not for LE_PROD #376

Closed
tmr-cf opened this issue Aug 26, 2021 · 2 comments
Closed

cPanel plugin works for LE_STAGE but not for LE_PROD #376

tmr-cf opened this issue Aug 26, 2021 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@tmr-cf
Copy link

tmr-cf commented Aug 26, 2021

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

  •     Submit-ChallengeValidation
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Submit-ChallengeValidation], ParameterBindingArgumentTransformationException
    • FullyQualifiedErrorId : ParameterArgumentTransformationError,Submit-ChallengeValidation

Any help debugging would be very much appreciated.

cPanel.zip

@rmbolger rmbolger self-assigned this Aug 26, 2021
@rmbolger rmbolger added the question Further information is requested label Aug 26, 2021
@rmbolger
Copy link
Owner

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?

@rmbolger
Copy link
Owner

Also, there appears to be a Production maintenance window happening at the moment which might cause some issues:

https://letsencrypt.status.io/

@rmbolger rmbolger closed this as completed Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants