examples: improve OpenSSL certificate examples#20807
examples: improve OpenSSL certificate examples#20807vszakats wants to merge 8 commits intocurl:masterfrom
Conversation
- fix/syncronize/add error messages. - return error from the callback as necessary. - scope a variable. - sync code/formatting between the two examples.
|
@aisle-analyzer augment review |
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
See details in the comment below. Analyzed PR: #20807 at commit Last updated on: 2026-03-03T22:54:47Z |
There was a problem hiding this comment.
Pull request overview
This PR makes minor improvements to two OpenSSL in-memory certificate example files (cacertinmem.c and usercertinmem.c). The changes aim to improve error messages (naming the failing function directly), propagate errors from the SSL context callback to the caller, scope variables more narrowly, and synchronize the code style between the two examples.
Changes:
- Error messages are updated to name the specific OpenSSL/curl function that failed (e.g.,
BIO_new_mem_buf() failedinstead of generic messages). - A
resultvariable is introduced in both files so the callback can return an error code instead of always returningCURLE_OK. mypem/mykeystring literals are moved to the top of the function and markedstatic, and variable declarations are reordered for consistency.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
docs/examples/usercertinmem.c |
Updates error messages, adds result variable, marks mypem/mykey as static, reorders declarations |
docs/examples/cacertinmem.c |
Updates error messages, adds result variable, restructures error handling, changes mypem from array to pointer, scopes loop variable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🤖 Augment PR SummarySummary: Refines the OpenSSL “certificate/key in memory” examples to behave more consistently on errors and to reduce leak/cleanup risks. Changes:
Technical Notes: Callbacks now return 🤖 Was this summary useful? React with 👍 or 👎 |
This comment was marked as outdated.
This comment was marked as outdated.
|
@aisle-analyzer augment review |
🔒 Aisle Security Analysis✅ We scanned this PR and did not find any security vulnerabilities. Aisle supplements but does not replace security review. Analyzed PR: #20807 at commit Last updated on: 2026-03-03T23:29:37Z |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
augment review |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://github.com/curl/curl/pull/20807/files?w=1