Skip to content

fix(proxy): use keyDir variable instead of string literal - #162

Open
Ajithkumar003-dev wants to merge 1 commit into
dstotijn:mainfrom
Ajithkumar003-dev:fix/cert-keyDir-literal
Open

fix(proxy): use keyDir variable instead of string literal#162
Ajithkumar003-dev wants to merge 1 commit into
dstotijn:mainfrom
Ajithkumar003-dev:fix/cert-keyDir-literal

Conversation

@Ajithkumar003-dev

Copy link
Copy Markdown

What

Fixes a one-line bug in LoadOrCreateCA where the CA-cert directory
existence check used the literal string "keyDir" instead of the
keyDir variable.

Why

This means the directory-exists check never evaluates the real path,
so os.MkdirAll never runs for the CA cert directory when it's missing
— unlike the CA key directory check just above it, which correctly
uses the variable.

Fixes #147

Testing

go build ./pkg/proxy/ and go vet ./pkg/proxy/ pass locally.

os.Stat("keyDir") checked a literal string rather than the keyDir
variable, so the CA certificate directory existence check never
evaluated the real path. The sibling check for the CA key directory
a few lines above already uses the variable correctly.

Fixes dstotijn#147
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

Successfully merging this pull request may close these issues.

use keyDir variable instead of string literal in LoadOrCreateCA

1 participant