Skip to content

Conversation

@matlec
Copy link

@matlec matlec commented Sep 9, 2025

When the HTTP client returns an error, it is not safe to access the response objectresp (e.g. when the server presents a certificate that the client does not trust) and the provider process will likely crash with a segfault exception.

When the HTTP client returns an error, it
is not safe to access the response object
`resp` (e.g. when the server presents a
certificate that the client does not trust)
and the provider process will likely crash
with a segfault exception.
Copy link
Collaborator

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

Any idea why we don't see crashes die to this issue? Can we somehow force the http get to fail so we can exercise this error path before and after your fix?

@matlec
Copy link
Author

matlec commented Sep 15, 2025

Probably we didn't see this error earlier as any ZEDEDA control server that is exposed to the Internet presents a certificate that is signed by a public CA, hence typically trusted by clients. But there could also be other failure modes (e.g. if a user configures a ZedCloud URL with an invalid URL scheme) that lead to a crash of the provider.

Examples to reproduce the error:

# Example 1: connect to a server with an untrusted root certificate
export TF_VAR_zedcloud_url=https://untrusted-root.badssl.com
# Example 2: configure an invalid URL scheme for the server address
export TF_VAR_zedcloud_url=invalid://zedcontrol.zededa.net

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.

3 participants