Description
``The readme file says the following:
Example for an authorization configuration that is used for the system tests:
{
"mode": "TLS",
"client-certificate": "test-secrets/kt-test.crt",
"client-certificate-key": "test-secrets/kt-test.key",
"ca-certificate": "test-secrets/snakeoil-ca-1.crt"
}
If any certificate or key path is simply the name of the file, it is assumed to be in the same directory as the auth file itself. For example if the path to the auth file is /some/dir/kt-auth.json then a "client-certificate": "kt-test.crt" will be qualified to /some/dir/kt-test.crt.
However, this doesn't appear to be true, or working as described. When leaving the filenames without an absolute or relative path, they seemingly become relative to the current working directory of the shell, rather than the auth file or the kt
binary.
let's say the auth file is in etc/
alongside the CA file, the auth certificate and the key. Running it as ./kt -auth etc/auth.json
will not work. However, if I first cd
into etc/
then I can run it as ../kt -auth auth.json
just fine.
The error message says:
failed to setup auth err=failed to read ca-certificate err=open ca.pem: no such file or directory
etc/auth.json
{
"mode": "TLS",
"client-certificate": "server.pem",
"client-certificate-key": "server.key",
"ca-certificate": "ca.pem"
}
tl;dr: From what I can tell, if only specified as filenames without any path, the path is always relative to current working directory, nothing else. The location of the auth file or the kt
binary seem to have zero impact on anything, and the variable values are always seen as relative to CWD whether or not they are written using a relative path or not.
Activity