Open inf17101 opened 1 month ago
The reason is that the polling in the cli does not know when certificates are rejected and the from_server channel object is in this case None
since the channel is closed:
// server_connection.rs:117
let poll_complete_state_response = async {
loop {
match self.from_server.recv().await {
Some(FromServer::Response(Response {
request_id: received_request_id,
response_content: ResponseContent::CompleteState(res),
})) if received_request_id == request_id => return Ok(res),
None => return Err("Channel preliminary closed."),
Some(message) => {
// [impl->swdd~cli-stores-unexpected-message~1]
self.missed_from_server_messages.push(message);
}
}
}
};
Maybe we need proper response handling so that the communication middleware can return a certificate error, then we can also distinguish in the CLI between the errors better and output the user any kind of certificate rejection error (invalid cipher set , what else ...) At a minimum we shall communicate to the user that the file path of the certificate is not valid if a wrong path is provided as argument and if there are some other issues with the certificates then we shall output at least that the communication has failed due to a certificate error (and optional some reason depending on the effort).
Currently working on this.
The reason that I found is that the error is indeed produced, but ignored at a higher level, inside grpc/src/client.rs - GRPCCommunicationsClient::run()
.
This issue was solved and solution merged. It can be closed now.
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.
tools/certs/create_certs.sh
to create certificates for developmentYou should see the following error message:
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