-
Notifications
You must be signed in to change notification settings - Fork 989
Load all certs in a CaBuffer #1224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afjoseph thanks for contributing and fixing this.
Only auto
needs to be replaced and a few clang-tidy things.
@COM8 Changes modified accordingly |
cpr/ssl_ctx.cpp
Outdated
// Create a memory BIO using the data of cert_buf | ||
// Note: It is assumed, that cert_buf is nul terminated and its length is determined by strlen | ||
char* cert_buf = static_cast<char*>(raw_cert_buf); | ||
bio_ptr bio = BIO_new_mem_buf(cert_buf, -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bio_ptr bio = BIO_new_mem_buf(cert_buf, -1); | |
BIO * bio = BIO_new_mem_buf(cert_buf, -1); |
I guess here I suggested the wrong type. The CI fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Hey! Thanks for the great project.
I noticed that
cpr::CaBuffer
doesn't load all certificates in the buffer: just the first one.PEM_read_bio_X509
is meant to run in a loop (some examples) to add all certs in the buffer. This PR covers this.It also fixes the inclusion of
openssl/pemerr.h
in BoringSSL, which doesn't exist. This closes #333 (comment)There's also an unused error printer that I removed, which caused issues with
-Werror
Cheers!