-
Notifications
You must be signed in to change notification settings - Fork 184
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 Certificate function doesn't set the "Require SNI checkbox" #357
Comments
I produced a workaround in my powershell script yesterday. I now understand that the setting of SslFlags clears the binding to the SSL Cert (Hash and StoreName). It looks to me as though the Certifcate cannot be applied at the same time as the binding is created or at the same time as the SslFlags are changed. You can verify this by use of the "Set-WebBinding" cmdlet with -PropertyName SslFlags and -Value 1, i.e. the flags are set, but the hash is clear. I couldn't work out how to install the certificate using "Import-Certificate" cmdlet - so I've worked out a way to use Install-ACMECertificate safely - the approach is as follows:
Here are the relevant code fragments from my script:
|
When using Install-Certificate, and where fresh bindings ARE created, the SslFlags are not set. This results in a binding being created without the "Require Server Name Indication" checkbox set.
On a system that hosts multiple websites, this is a disaster, because if you then subsequently Install-Certificate into a new site, both of these non-SNI bindings get allocated the new certificate. Obviously this breaks websites if their SslFlags aren't right.
If you look in the code for IisHelper, you can see that the Add for the binding uses a 3 parameter overload, but I have read something that suggests that there is a 4 parameter overload that exists in libraries that come with later windows OS distributions. The UpdateBinding function in the helper looks like it would set the appropriate flags but damage to the server would already have been done.
Regards,
Mark
The text was updated successfully, but these errors were encountered: