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

ACMESharp doesn't get recognized #49

Closed
ZmorzynskiK opened this Issue Feb 1, 2017 · 16 comments

Comments

Projects
None yet
5 participants
@ZmorzynskiK

ZmorzynskiK commented Feb 1, 2017

I stumbled upon very strange and annoying issue. After starting Certify, it displays a MessageBox saying that ACMESharp isn't installed.
However, I installed it and when I execute:
Get-Module -ListAvailable ACMESharp
in Powershell console I get:

Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary     0.8.1      ACMESharp                           {Get-Certificate, Get-ChallengeHandlerProfile, Get-Iden...

so it looks like ACMESharp is installed.

I run Certify as administrator on Windows Server 2012 R2.
What's going on? I'll appreciate any help.

@ZmorzynskiK

This comment has been minimized.

Show comment
Hide comment
@ZmorzynskiK

ZmorzynskiK Feb 1, 2017

Ok, so I figured it out. Maybe it'll help someone.

It turned out, that the ACMESharp module was installed, but was not in the proper directory. Apparently, C:\Program Files\WindowsPowerShell\Modules (the one that has ACMESharp module installed) isn't used by Powershell initialized in Certify, but other directories are taken into account. Not sure why it's like that, but it is.

So I copied whole ACMESharp module directory from C:\Program Files\WindowsPowerShell\Modules\ACMESharp
to
c:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\ (for 32 bits apps usage)
and to
c:\Windows\system32\WindowsPowerShell\v1.0\Modules\ (just in case for 64 bits apps)

After restarting Certify - it started to work.

ZmorzynskiK commented Feb 1, 2017

Ok, so I figured it out. Maybe it'll help someone.

It turned out, that the ACMESharp module was installed, but was not in the proper directory. Apparently, C:\Program Files\WindowsPowerShell\Modules (the one that has ACMESharp module installed) isn't used by Powershell initialized in Certify, but other directories are taken into account. Not sure why it's like that, but it is.

So I copied whole ACMESharp module directory from C:\Program Files\WindowsPowerShell\Modules\ACMESharp
to
c:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\ (for 32 bits apps usage)
and to
c:\Windows\system32\WindowsPowerShell\v1.0\Modules\ (just in case for 64 bits apps)

After restarting Certify - it started to work.

@ZmorzynskiK ZmorzynskiK closed this Feb 1, 2017

@webprofusion-chrisc

This comment has been minimized.

Show comment
Hide comment
@webprofusion-chrisc

webprofusion-chrisc Feb 2, 2017

Contributor

Reopening to track this problem. We need to decide how best to handle this for others, the PowerShell module installation is likely one of the biggest hurdles for users.

Contributor

webprofusion-chrisc commented Feb 2, 2017

Reopening to track this problem. We need to decide how best to handle this for others, the PowerShell module installation is likely one of the biggest hurdles for users.

@ZmorzynskiK

This comment has been minimized.

Show comment
Hide comment
@ZmorzynskiK

ZmorzynskiK Feb 2, 2017

Thinking about it, it looks like they're at least 2 or 3 Powershell "module repositories" in Windows 64 bit.

I'd expect modules to land in c:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\ when installing from 32 bit Powershell, and to c:\Windows\system32\WindowsPowerShell\v1.0\Modules\ when installing from 64 bit Powershell, but I don't understand why it landed in C:\Program Files\WindowsPowerShell\Modules\ACMESharp when installing from 64 bit Powershell (run as administrator). This prevented Certify from finding the module.

What may be the reason for this? Maybe it's a Nuget related issue?

ZmorzynskiK commented Feb 2, 2017

Thinking about it, it looks like they're at least 2 or 3 Powershell "module repositories" in Windows 64 bit.

I'd expect modules to land in c:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\ when installing from 32 bit Powershell, and to c:\Windows\system32\WindowsPowerShell\v1.0\Modules\ when installing from 64 bit Powershell, but I don't understand why it landed in C:\Program Files\WindowsPowerShell\Modules\ACMESharp when installing from 64 bit Powershell (run as administrator). This prevented Certify from finding the module.

What may be the reason for this? Maybe it's a Nuget related issue?

@amilo2003

This comment has been minimized.

Show comment
Hide comment
@amilo2003

amilo2003 Feb 2, 2017

I was using version 0.8? and I am now trying to renew the certificate. I ran into the same issue as above, thanks @ZmorzynskiK for your solution!

I however receive this error message now:
Challenge not yet completed. Check that http://www.test.com/ACMESharp.AuthorizeChallenge path/file is present and accessible in your web browser.

Thereafter app crashes with error:
Certificate has not been submitted yet, cannot update status.

The .well-known path exists

Do I need to create new path manually?

amilo2003 commented Feb 2, 2017

I was using version 0.8? and I am now trying to renew the certificate. I ran into the same issue as above, thanks @ZmorzynskiK for your solution!

I however receive this error message now:
Challenge not yet completed. Check that http://www.test.com/ACMESharp.AuthorizeChallenge path/file is present and accessible in your web browser.

Thereafter app crashes with error:
Certificate has not been submitted yet, cannot update status.

The .well-known path exists

Do I need to create new path manually?

@ZmorzynskiK

This comment has been minimized.

Show comment
Hide comment
@ZmorzynskiK

ZmorzynskiK Feb 2, 2017

@amilo2003 I'm using the newest version of ACMESharp which is 0.8.1.
Do you have anything inside .well-known folder? There should be another folder (acme-challenge) inside with some files.

AFAIR just to be sure I created those two folders manually and placed there web.config with contents:

<?xml version = "1.0" encoding="UTF-8"?>
 <configuration>
     <system.webServer>
          <staticContent>
	        <mimeMap fileExtension="." mimeType="text/plain" />
   </staticContent>
     </system.webServer>
 </configuration>

Everything then went smoothly.

ZmorzynskiK commented Feb 2, 2017

@amilo2003 I'm using the newest version of ACMESharp which is 0.8.1.
Do you have anything inside .well-known folder? There should be another folder (acme-challenge) inside with some files.

AFAIR just to be sure I created those two folders manually and placed there web.config with contents:

<?xml version = "1.0" encoding="UTF-8"?>
 <configuration>
     <system.webServer>
          <staticContent>
	        <mimeMap fileExtension="." mimeType="text/plain" />
   </staticContent>
     </system.webServer>
 </configuration>

Everything then went smoothly.

@amilo2003

This comment has been minimized.

Show comment
Hide comment
@amilo2003

amilo2003 Feb 2, 2017

Thanks, it worked! All renewed now.

amilo2003 commented Feb 2, 2017

Thanks, it worked! All renewed now.

@htline

This comment has been minimized.

Show comment
Hide comment
@htline

htline Feb 2, 2017

So I did above and still having the original issue. Using Windows Server 2012 R2 and the latest (at time of writing) version of Certify
`PS C:\Users\Administrator> Get-Module -ListAvailable ACMESharp

Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version Name ExportedCommands


Binary 0.8.1 ACMESharp {Get-Certificate, Get-ChallengeHandlerProfile, Get-Identif...

Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules

ModuleType Version Name ExportedCommands


Binary 0.8.1 ACMESharp {Get-Certificate, Get-ChallengeHandlerProfile, Get-Identif...`
Is there another command I'm not aware of? Not experienced with PowerShell or PowerShell Gallery.
It worked fine until I updated to latest version of Certify and now it broke. I have SSL certs installed by Certify from the previous version.

htline commented Feb 2, 2017

So I did above and still having the original issue. Using Windows Server 2012 R2 and the latest (at time of writing) version of Certify
`PS C:\Users\Administrator> Get-Module -ListAvailable ACMESharp

Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version Name ExportedCommands


Binary 0.8.1 ACMESharp {Get-Certificate, Get-ChallengeHandlerProfile, Get-Identif...

Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules

ModuleType Version Name ExportedCommands


Binary 0.8.1 ACMESharp {Get-Certificate, Get-ChallengeHandlerProfile, Get-Identif...`
Is there another command I'm not aware of? Not experienced with PowerShell or PowerShell Gallery.
It worked fine until I updated to latest version of Certify and now it broke. I have SSL certs installed by Certify from the previous version.

@ZmorzynskiK

This comment has been minimized.

Show comment
Hide comment
@ZmorzynskiK

ZmorzynskiK Feb 2, 2017

@HunterLine did you copied the ACMESharp module also to c:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\?

ZmorzynskiK commented Feb 2, 2017

@HunterLine did you copied the ACMESharp module also to c:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\?

@htline

This comment has been minimized.

Show comment
Hide comment
@htline

htline Feb 2, 2017

It is a 64-bit OS, should I create the folder for 32-bit

htline commented Feb 2, 2017

It is a 64-bit OS, should I create the folder for 32-bit

@ZmorzynskiK

This comment has been minimized.

Show comment
Hide comment
@ZmorzynskiK

ZmorzynskiK Feb 2, 2017

Yes, SysWOW64 is for 32 bit apps. Just check if you have folder named c:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\ and copy ACMESharp there.

ZmorzynskiK commented Feb 2, 2017

Yes, SysWOW64 is for 32 bit apps. Just check if you have folder named c:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\ and copy ACMESharp there.

@alecrespo

This comment has been minimized.

Show comment
Hide comment
@alecrespo

alecrespo Feb 2, 2017

Hi @ZmorzynskiK I run the ps and then copy the module to

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules
C:\Windows\system32\WindowsPowerShell\v1.0\Modules

Still Certify cannot find it. I'm missing something?

alecrespo commented Feb 2, 2017

Hi @ZmorzynskiK I run the ps and then copy the module to

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules
C:\Windows\system32\WindowsPowerShell\v1.0\Modules

Still Certify cannot find it. I'm missing something?

@ZmorzynskiK

This comment has been minimized.

Show comment
Hide comment
@ZmorzynskiK

ZmorzynskiK Feb 2, 2017

Just to be 100% sure: are you invoking all those PS commands and Certify app as administrator? Do you see the module (Get-Module -ListAvailable ACMESharp) in both those directories when running 32bit version of PS and 64bit version of PS?

ZmorzynskiK commented Feb 2, 2017

Just to be 100% sure: are you invoking all those PS commands and Certify app as administrator? Do you see the module (Get-Module -ListAvailable ACMESharp) in both those directories when running 32bit version of PS and 64bit version of PS?

@webprofusion-chrisc

This comment has been minimized.

Show comment
Hide comment
@webprofusion-chrisc

webprofusion-chrisc Feb 3, 2017

Contributor

I think this answers my suspicion that using the ACMESharp from PowerShell gallery is just too complicated. We will migrate to using our own build of ACMESharp as soon as we can.

Contributor

webprofusion-chrisc commented Feb 3, 2017

I think this answers my suspicion that using the ACMESharp from PowerShell gallery is just too complicated. We will migrate to using our own build of ACMESharp as soon as we can.

@ZmorzynskiK

This comment has been minimized.

Show comment
Hide comment
@ZmorzynskiK

ZmorzynskiK Feb 3, 2017

@soundshed great, I can try to help if needed.

ZmorzynskiK commented Feb 3, 2017

@soundshed great, I can try to help if needed.

@webprofusion-chrisc

This comment has been minimized.

Show comment
Hide comment
@webprofusion-chrisc

webprofusion-chrisc Feb 4, 2017

Contributor

A new version of Certify has now been release which bundles a local copy of ACMESharp, removing the need for the Install-Module step. Please try it out :)

Contributor

webprofusion-chrisc commented Feb 4, 2017

A new version of Certify has now been release which bundles a local copy of ACMESharp, removing the need for the Install-Module step. Please try it out :)

@webprofusion-chrisc

This comment has been minimized.

Show comment
Hide comment
@webprofusion-chrisc

webprofusion-chrisc Feb 5, 2017

Contributor

Resolved in latest release. Closing.

Contributor

webprofusion-chrisc commented Feb 5, 2017

Resolved in latest release. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment