Deck Authentication fails with `find any PEM data in certificate input`
- Dominant language
- Go
- Stars
- 503
- Forks
- 137
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 20
Description
I was trying to use documentation specified in link
https://docs.konghq.com/deck/gateway/configuration/
Found multiple issues
1. As specified in documentation `--tls-client-cert-key` is not a valid argument. On checking the source code it should be `--tls-client-key-file`
2. On changing the command to
`deck gateway ping --kong-addr https://kong-cp-kong-admin.infra.svc.cluster.local:8444 --ca-cert-file /secrets/kong-admin-api-tls/ca.crt --tls-client-key-file /secrets/kong-admin-api-tls/tls.key --tls-client-cert-file /secrets/kong-admin-api-tls/tls.crt`
It started throwing `fails with find any PEM data in certificate input` on executing this command.
On further debugging it
setting `--tls-client-key-file` evaluates `clientKeyContent := viper.GetString("tls-client-key")` in source code to `/secrets/kong-admin-api-tls/tls.key`
As shown in code snippet

I suspect issue is related to viper bind flags. Did not spent time on debugging it further.
For now I am setting up env `DECK_TLS_CLIENT_KEY_FILE` and `DECK_TLS_CLIENT_CERT_FILE`, until viper issue is addressed.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the `deck gateway ping` command and the source path that reads `viper.GetString("tls-client-key")`; inspect how `--tls-client-key-file` and `--tls-client-cert-file` are bound. Reproduce the command with the documented flags and verify that the file contents, rather than their paths, are used and that the PEM error is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100