Im am trying the 3rd party ca Auto enrollment feature instead of ott, but when i enroll the client it gives the following error -:
failed to enroll: expected 1 or more CAs from controller, got 0
Here are the detailed steps that I followed, let me know if I missed out on any step -
#creating a third party ca with isAutoCaEnrollmentEnabled
property set to true (cli)
ziti pki create ca --pki-root="${ZITI_PKI}" --ca-file "${ca_name}" --ca-name "${ca_name}"
#copying the cert and adding in the ziti console with the 'is AutoCaEnrollmentEnabled' property enabled
cat "$ZITI_PKI/${ca_name}/certs/${ca_name}.cert"
#next I verified the created ca with the controller by creating a client cert using this ca
ziti edge list cas //gives the verification token
identity_to_verify = {verification token}
ziti pki create client
--pki-root="${ZITI_PKI}"
--ca-name=${ca_name}
--client-name=${identity_to_verify}
--client-file=${identity_to_verify}
then I copied this client cert on the console and verified my ca
#Now, I created a client PKI with
client_name as format
ziti pki create client
--pki-root="${ZITI_PKI}"
--ca-name=${ca_name}
--client-name=${client_name}
--client-file=${client_name}
Now, since identity creation will be automatic, i directly went ahead and enrolled the client using the reusable jwt token from 3rd party ca.
ziti edge enroll --jwt "auto.jwt"
--cert "$ZITI_PKI/$ca_name/certs/${identity_name}.cert"
--key "$ZITI_PKI/$ca_name/keys/${identity_name}.key"
--out "$ZITI_PKI/$ca_name/keys/${identity_name}.json"
failed to enroll: expected 1 or more CAs from controller, got 0
I even tested with the ca bundle
curl -sk https://${ZITI_EDGE_CTRL_ADVERTISED}/.well-known/est/cacerts > ${ZITI_PKI}/fetched-ca-certs.p7
openssl base64 -d -in ${ZITI_PKI}/fetched-ca-certs.p7 | openssl pkcs7 -inform DER -outform PEM -print_certs -out ${ZITI_PKI}/fetched-ca-certs.pem
identity_full_ca_path="${ZITI_PKI}/fetched-ca-certs.pem"
ziti edge enroll --jwt "auto.jwt" --cert "$ZITI_PKI/$ca_name/certs/${identity_name}.cert" --key "$ZITI_PKI/$ca_name/keys/${identity_name}.key" --ca "${identity_full_ca_path}" --out "$ZITI_PKI/$ca_name/keys/${identity_name}.json"
failed to enroll: expected 1 or more CAs from controller, got 0