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

Fix bug in PSPKI version check because of which New-SelfsignedCertifi… #31

Merged
merged 1 commit into from Sep 26, 2017

Conversation

aviade
Copy link

@aviade aviade commented Sep 22, 2017

Code that compares PSPKI version has a bug.
First, there's a typo -PSPKIVersion.Major is used instead of PspkiVersion .Major (PS is case sensetive)
Second, -ieq is not the right comparison operator for a verion.

$PspkiVersion = (Get-Module PSPKI).Version
if($PSPKIVersion.Major -ieq 3 -And $PspkiVersion.Minor -ieq 2 -And $PspkiVersion.Build -ieq 5) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice type here, PSPKIVersion is used instead of PspkiVersion

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also - when PSPKI latest version is used (3.2.6) - this condition returns false, thus New-SelfsignedCertificate is used instead of New-SelfsignedCertificateEx. Which is a big problem since Service Fabric services fail (with 'failed to read private key from certificate') to start when using a cert that was created via New-SelfsignedCertificate.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thankyou @aviade

@aviade aviade mentioned this pull request Sep 22, 2017
@ChackDan ChackDan merged commit 2eda11b into ChackDan:master Sep 26, 2017
@antonGritsenko
Copy link

This entire check cause real mess on Win10, where New-SelfSignedCertificate is exist without installation of PSPKI module and looks like produce wrong certificate (https://stackoverflow.com/questions/39378519/service-fabric-cluster-nodes-cant-get-private-key-from-certificate).

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

Successfully merging this pull request may close these issues.

None yet

4 participants