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

Facter['fqdn'] should be Facter['clientcert'] #3

Open
logicminds opened this issue Jan 9, 2017 · 0 comments
Open

Facter['fqdn'] should be Facter['clientcert'] #3

logicminds opened this issue Jan 9, 2017 · 0 comments

Comments

@logicminds
Copy link

Certs don't always use the fqdn as the CN. We need to rely on the actual cert name instead.

This is specially true when windows hostnames are in upper case and the cert name is lowercase.

var_cmd = "powershell @(get-childitem certificate::localmachine/my ^| where-object { $_.issuer -eq '#{issuer_subject}' -and $_.subject -eq 'CN=#{Facter['fqdn'].value}' -and $_.hasprivatekey} ^| sort-object -property notafter -descending)[0].thumbprint"


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

1 participant