Anyone use Powershell to sign certs?

27 views
Skip to first unread message

Ryan Murphy

unread,
Apr 9, 2018, 3:26:54 PM4/9/18
to Puppet Users
Been trying to write a script that will sign a cert for a new node, but I don't seem to be having any luck. 

Here is the code I have so far

[System.net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

$console_server
= 'puppetserver'

$node
= "new-test-server.local"

$action
= '{"desired_state":"signed"}'

$json
= $action | ConvertTo-Json


$url
= "https://${console_server}:8140/puppet-ca/v1/certificate_status/${node}"

echo $url

$results
= Invoke-RestMethod -Uri $url -body $json -method PUT -ContentType 'application/pson'

echo $results

I've spent most of the day trying to figure this one out. Any help would be appreciated./
Reply all
Reply to author
Forward
0 new messages