Skip to content

Conversation

@jsoriano
Copy link
Member

@jsoriano jsoriano commented Jan 22, 2025

When using elastic-package with environment variables with a profile
without a configured stack, avoid using the default CA certificate
file if it neither exists.

Fix #2365

@jsoriano jsoriano self-assigned this Jan 22, 2025
@jsoriano jsoriano requested a review from a team January 22, 2025 17:43
caCertFile := profile.Path(CACertificateFile)
// Use CA file in the profile only if it exists.
if _, err := os.Stat(caCertFile); err == nil {
config.CACertFile = caCertFile
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely never going to happen. This can only happen with data directories created with some very old versions of elastic-package, that didn't have profile config, but had certificates.

It would be probably fine to just don't set the CA cert file, keeping it just in case.

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @jsoriano

@jsoriano jsoriano merged commit 84f07ab into elastic:main Jan 22, 2025
3 checks passed
@jsoriano jsoriano deleted the clients-without-certificate branch January 22, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants