Closed xaviershay closed 9 years ago
I'm unsure if the default CA we included contains a private key.
The following keystore should work: keytool -list -keystore ./server/src/test/resources/clients/client.p12 -storetype PKCS12 -storepass ponies
outputs PrivateKeyEntry
.
If you want to see the key and cert, you can do: openssl pkcs12 -in <keystore.p12> -out cert.pem; openssl x509 -text -in cert.pem
.
The default db seed command sets the automation flag to true for this cert (https://github.com/square/keywhiz/blob/master/server/src/main/java/keywhiz/commands/DbSeedCommand.java#L116). It is possible that I got "client" vs "CN=client" wrong in the DbSeed code.
This worked for me, turns out curl accepts p12
!
curl -k https://localhost:4444/automation/secrets --cert ./server/src/test/resources/clients/client.p12:ponies
I'm going to update https://github.com/square/keywhiz/wiki/Development-and-test-key-material#create-a-server-certificate to be: openssl pkcs12 -export -in out/localhost.crt -inkey out/localhost.key -out out/localhost.p12
.
I would like to use the automation endpoints.
The documentation suggests that "The automation API requires a client certificate and automationAllowed=true in the clients DB table." ... but how do I set this up?
From poking around I think if I send a POST to
/automation/clients
with my client cert it should just work. But how do I make this initial client cert? There are various.p12
and.crt
files in the core checkout, but seems to be missing a.key
file to make into a CA pem that I can use to sign a new client cert. I tried converting the.p12
to a.pem
on the off chance that made sense, but didn't work.Trying to regenerate key material (which would give me all the private/public keys), I run into this error in the https://github.com/square/keywhiz/wiki/Development-and-test-key-material#create-a-server-certificate step
So now I'm knee deep in cert things and pretty sure I shouldn't be here :) What did I miss?