ankaios icon indicating copy to clipboard operation
ankaios copied to clipboard

Improve mTLS error messages upon wrong field values in the Ankaios CLI

Open inf17101 opened this issue 7 months ago • 1 comments

Description

Currently, if the user enters a wrong path for the certificates or key in an Ankaios CLI, then the error message is "Channel preliminary closed." which is not helpful to the user since it is an internal Rust channel error message. This is independent of using the environment variables or the cli arguments directly.

  1. Execute the script tools/certs/create_certs.sh to create certificates for development
  2. Start the server and agent with certificates
  3. Execute an ank cli command and provide an invalid file path to some of the arguments, e.g.:
./ank -v --ca_pem .certs/ca.pem --crt_pem .certs/cli.pem --key_pem asdfg get workloads

You should see the following error message:

image

Goals

Enhance the Ankaios CLI to output helpful error messages when an mTLS setting has an invalid value.

Final result

Summary

To be filled when the final solution is sketched.

Tasks

  • [ ] Output "file path does not exist" as error message
  • [ ] Analyze if not just the invalid file path can be output, but to output a Certificate Error even it is rejected due to other reasons (Maybe this needs to be included into the request handling and the communication middleware)

inf17101 avatar Jul 25 '24 09:07 inf17101