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

Install-ACMECertificate and centralized Certificate store #352

Open
frapps opened this issue Aug 21, 2018 · 5 comments
Open

Install-ACMECertificate and centralized Certificate store #352

frapps opened this issue Aug 21, 2018 · 5 comments

Comments

@frapps
Copy link

frapps commented Aug 21, 2018

When installing a certificate into IIS using Install-ACMECertificate with the force parameter set to true, the require SNI And use centralized Certificate store values get set to try and the certificate itself is not used.

The actual certificate is install, so I just need to untick these values and select the ssl certifcate in iis. But how do I create this effect without manual intervention.

WIthout using force, there is a conflicting binding.

@JohnLBevan
Copy link

The issue seems to be down to this line:

b.SetAttributeValue("sslFlags", 3);

I'm not sure what the logic is behind that, so haven't submitted a pull request. Perhaps simply changing this:

if (binding.BindingHostRequired.GetValueOrDefault() && GetIisVersion().Major >= 8)
    b.SetAttributeValue("sslFlags", 1);
else
    b.SetAttributeValue("sslFlags", 3);

to this would work though (without knowing why this was implemented I wouldn't want to make a pull request though).

if (binding.BindingHostRequired.GetValueOrDefault() && GetIisVersion().Major >= 8)
{
    b.SetAttributeValue("sslFlags", 1);
}
else
{
    int sslFlags = 3;
    int.TryParse(binding.GetAttributeValue("sslFlags") , out sslFlags);
    if (certStore.Equals(binding.CertificateStoreName))
        b.SetAttributeValue("sslFlags", sslFlags);
    else
        b.SetAttributeValue("sslFlags", 3);
}

Likely something even simpler could be used; the above is just attempting to minimize side effects as I don't know the requirement driving this logic.

JohnLBevan pushed a commit to JohnLBevan/ACMESharp that referenced this issue Jul 12, 2019
@JohnLBevan
Copy link

(actually - I've made a non-breaking change; adding a parameter so people not hitting this issue can use as they do today, but those of us wishing to bypass this issue can add the KeepExistingSslFlags = $true property to the InstallerParameters hashtable to keep the original binding's values.)

ebekker added a commit that referenced this issue Jul 16, 2019
#352 - Allow sslFlags to remain unchanged.
@RagingAlphaWalrus
Copy link

I'm still experiencing this issue, even following updating the module to the latest build. I have multiple bindings to a single site, each binding with a different SSL Certs. After I execute the following command:

Install-ACMECertificate -CertificateRef atc -Installer iis -InstallerParameters @{ WebSiteRef = 'IIS Site Name'; KeepExistingSslFlags = $true; Force = $true}

My other bindings stop working, & when I look at them, I see the following error (see below image).

bindingerror

Am I doing something wrong? Is there something different that I should be doing? Thank you so much!!

@JohnLBevan
Copy link

That looks correct, though you've not specified values for the BindingAddress, BindingPort, or BindingHost installer parameters, which differs from what I've got. Have you tried specifying those options?

Please can you take a look at: C:\Windows\System32\inetsrv\config\applicationHost.config
View the binding information for the site (under path: /configuration/system.applicationHost/sites/site/bindings/binding).
What value does the sslFlags attribute have / does it change after the script's run?

I've not had a chance to look closer, but hopefully answers to the above will help determine where the issue is.

JohnLBevan pushed a commit to JohnLBevan/ACMESharp that referenced this issue Aug 4, 2019
@JohnLBevan
Copy link

Actually this is my fault... just tried the version from the PS Gallery and realised it behaved differently to my local copy / after digging around found I'd not included one of the files when staging for commit. This is now fixed via this commit; though will not be available in the module until the pull request's accepted: JohnLBevan@370024c

JohnLBevan pushed a commit to JohnLBevan/ACMESharp that referenced this issue Aug 7, 2019
ebekker added a commit that referenced this issue Aug 7, 2019
#352 - allow ssl flags to remain unchanged
JohnLBevan pushed a commit to JohnLBevan/ACMESharp that referenced this issue Aug 12, 2019
…KeepExistingSslFlags would have shown as Force
JohnLBevan pushed a commit to JohnLBevan/ACMESharp that referenced this issue Aug 12, 2019
…KeepExistingSslFlags would have shown as Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants