Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth file paths don't work as documented #147

Open
Endemoniada opened this issue Oct 24, 2024 · 0 comments
Open

Auth file paths don't work as documented #147

Endemoniada opened this issue Oct 24, 2024 · 0 comments

Comments

@Endemoniada
Copy link

Endemoniada commented Oct 24, 2024

``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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant