You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With version 1.11.1 passing a private key as blob as described in the docs (https://docs.libcpr.org/advanced-usage.html) does not work. The following error is returned: unable to set private key file: '(memory blob)' type PEM
In the curl documentation it is stated: If the blob is initialized with the flags member of struct curl_blob set to CURL_BLOB_COPY, the application does not have to keep the buffer around after setting this.
=> If it CURL_BLOB_COPY is not set the buffer has to be kept alive until the request is performed.
As far is I can understand key_blob will go out of scope and be destroyed after the if-branch, thus CURL_BLOB_COPY needs to be set.
When set, it works as expected.
Where did you get it from?
GitHub (branch e.g. master)
Additional Context/Your Environment
OS: Debian
Version: 1.11.1
The text was updated successfully, but these errors were encountered:
Description
With version 1.11.1 passing a private key as blob as described in the docs (https://docs.libcpr.org/advanced-usage.html) does not work. The following error is returned:
unable to set private key file: '(memory blob)' type PEM
Example/How to Reproduce
Like in the example:
Possible Fix
In the session.cpp file https://github.com/libcpr/cpr/blob/master/cpr/session.cpp#L471 the local string
key_blob
is assigned to theblob.data
value.In the curl documentation it is stated:
If the blob is initialized with the flags member of struct curl_blob set to CURL_BLOB_COPY, the application does not have to keep the buffer around after setting this.
=> If it CURL_BLOB_COPY is not set the buffer has to be kept alive until the request is performed.
As far is I can understand
key_blob
will go out of scope and be destroyed after the if-branch, thusCURL_BLOB_COPY
needs to be set.When set, it works as expected.
Where did you get it from?
GitHub (branch e.g. master)
Additional Context/Your Environment
The text was updated successfully, but these errors were encountered: