ACMESharp icon indicating copy to clipboard operation
ACMESharp copied to clipboard

Complete-ACMEChallenge : The given key was not present in the dictionary

Open ebekker opened this issue 8 years ago • 10 comments

I'm posting this ticket on behalf of icannotgetafreename from his YouTube comments section:


I'm trying to make a video for the newer version of AcmeSharp but I get the following error: Complete-ACMEChallenge : The given key was not present in the dictionary. When I issue the command: Complete-ACMEChallenge www.examplesite.com_Identifier -ChallengeType http-01 -Handler iis -HandlerParameters @{ WebSiteRef = 'Default Web Site' }

Further research seems that the -Handler parameter might be missing "iis" (iirc think the command works if I use manual). I also couldn't see much IIS referenced in the github source (but I'm no expert in the language so might just be failing to read it correctly). Is the IIS handler not built yet?

ebekker avatar Feb 23 '16 11:02 ebekker

The error that you're getting The given key was not present in the dictionary is just a generic error that a Hashtable was accessed with a missing key, which usually translates into a lookup for one of the Vault-stored entities by its Alias.

There are a few bookkeeping cmdlets you can run to make sure the parameters to the Complete-* cmdlet are valid:

  • Get-ACMEIdentifier -- with no arguments, this cmdlet will list all the current Identifiers you have in the Vault; if you give it an Identifier reference (e.g. sequence number, Alias or GUID) it will give you more details about that particular Identifier
  • Get-ACMEChallengeHandlerProfile -ListChallengeTypes -- this will return the list of all Challenge Types that are currently registered and available in the current PS session, e.g. dns-01, http-01
  • Get-ACMEChallengeHandlerProfile -ListChallengeHandlers -- this will return the list of all Challenge Handlers that are currently registered and available in the current PS session, e.g. manual, iis, awsRoute53, awsS3
  • Get-ACMEChallengeHandlerProfile -GetChallengeHandler iis -ParametersOnly -- this form of the cmdlet will list details about the parameters that must or may be specified for the named Challenge Handler type

With these cmdlets you can ensure that the parameters to your Complete-ACMEChallenge call are all correct, for example that the Identifier reference is valid. If you run these and everything seems to be specified correctly and you still get this error, then there might be a bug somewhere and we can trace through that.

ebekker avatar Feb 23 '16 11:02 ebekker

Regarding the iis Handler, many subsystems of ACMESharp PS module are designed using a provider model so that it can be easily and quickly extended. The Challenge Handlers are no exception so the only "built-in" Handler Provider in the core library assembly is the manual Handler, and the IIS Handler is added in dynamically from its own dedicated assembly.

Depending on how you installed the ACMESharp PS module (e.g. using chocolatey, using the PowerShell Gallery, simply downloading and unzipping), you may get a different set of providers installed with the base.

Can you tell me what version of the module you're using and how you installed it?

ebekker avatar Feb 23 '16 11:02 ebekker

I just got "bit" by this.

I've downloaded https://github.com/ebekker/ACMESharp/releases/download/v0.8.1.0-EA/ACME-posh.zip and decompressed the contents of the Debug\ACMESharp into C:\Program Files\WindowsPowerShell\Modules\ACMESharp

I'm testing it on a temporary Win2012 R2 virtual machine on azure, so no chocolatey nor PS 5.0.

For IIS it looks like the .zip file is missing the ACMESharp.Providers.IIS.dll file that exists on acmesharp-posh-all.0.8.1.0.nupkg . Copying both the dll and pdb file from the nupkg into C:\Program Files\WindowsPowerShell\Modules\ACMESharp fixes this problem.

I think the provider files should be in the .zip file as they are in the nupkg, no?

brunomlopes avatar Feb 23 '16 16:02 brunomlopes

This sounds very much like my problem too! Thank you.I will investigate later.

drsox avatar Feb 23 '16 16:02 drsox

Is this going to be fixed in the .zip file release?

drsox avatar Mar 02 '16 22:03 drsox

Had the same issue but caused by the fact that the keys are case sensitive so I was using -Handler:Manual not -Handler:manual

sebastianrogers avatar Jan 19 '17 13:01 sebastianrogers

Provider names will be case-insensitive starting in the next 0.8.2 release.

ebekker avatar Jan 19 '17 13:01 ebekker

Excellent.


From: Eugene Bekker [email protected] Sent: 19 January 2017 13:56:48 To: ebekker/ACMESharp Cc: Sebastian Rogers; Comment Subject: Re: [ebekker/ACMESharp] Complete-ACMEChallenge : The given key was not present in the dictionary (#101)

Provider names will be case-insensitive starting in the next 0.8.2 release.

You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ebekker/ACMESharp/issues/101#issuecomment-273782126, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFtHXMagC9jrWpLHFKUcJ9vP6ou_kdisks5rT2uggaJpZM4Hghf6.

sebastianrogers avatar Jan 20 '17 10:01 sebastianrogers

Probably have the same issue. I downloaded the newest release (0.9.0). When I do Complete-ACMEChallenge with iis it returns the given identifier was not found in the registry. Then I listed challenge handlers and only saw manual. How can I get the iis handler? @ebekker

zhangjinzhou avatar Oct 06 '17 18:10 zhangjinzhou

Only the manual handlers are "in the box" -- now, you need to install all the other handlers as separate PS modules, and then enable them.

Please see this step for an example of how to do this. And this list of available Provider Modules.

ebekker avatar Oct 26 '17 17:10 ebekker