Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions iocore/net/SSLUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2477,6 +2477,8 @@ SSLMultiCertConfigLoader::load_certs(SSL_CTX *ctx, const std::vector<std::string
// Load up any additional chain certificates
if (!SSL_CTX_add_extra_chain_cert_bio(ctx, bio.get())) {
Debug("ssl_load", "couldn't add chain to %p", ctx);
SSLError("failed to load intermediate certificate chain from %s", cert_names_list[i].c_str());
return false;
Copy link
Contributor

@ywkaras ywkaras Dec 7, 2022

Choose a reason for hiding this comment

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

Clearly this should be an Error. But, if you look at the call stack this function is at the bottom of, it's not clear whether or not it's better to return false here. I assume none of these errors cause Fatal() calls because of the reload case. TS code tends avoid exiting on a reload error. Without necessarily considering it may be worse to keep running in a corrupt state.

Unfortunately, in industrial source bases, even those relied on by established, successful companies, it's risky to assume that something sensible will be done with an error return from a function. https://www.youtube.com/watch?v=lt-udg9zQSE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This error handling replicates the behavior of all other errors (i.e. secret_data.empty() and when cert fails to load certificate chain). Similar to those, it should exit out of that function immediately

Copy link
Contributor

Choose a reason for hiding this comment

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

Have you seen this happen in production?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, not on this specific error. This was the only error case that didn't add a SSLError and exit with returning false

Copy link
Contributor

Choose a reason for hiding this comment

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

Hopefully someone who knows this code better than I do will take a quick look.

}

if (secret_key_data.empty()) {
Expand Down