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
curl_easy_perform locks when using mbedtls #737
Comments
Could be the same. Can you tell us how to reproduce this issue, ideally against a public URL? |
Here is an example which triggers the problem. For information, the platform is a cortex M4 chip and the ciphersuite used is TLS-RSA-WITH-AES-128-GCM-SHA256. I will perform test with other ciphersuites. Let me know if you are able to reproduce.
|
I tried to reproduce it from my linux box, but failed:
|
Can you use a debugger or strace or something to figure out which function that gets stuck, or where the loop is? |
I have finally found the bug.
... which always returns 0. I got the good behaviour with :
This problem will only occur with small values of CURL_MAX_WRITE_SIZE (=500 in my embedded application). Indeed, if CURL_MAX_WRITE_SIZE is sufficiently high, the expected return value will always be 0 and the trivial implementation works. |
@damv, Can you please produce a full patch or pull-request with the change you made to get it working? |
mbedtls_ssl_pending? where is that? I can't find it in the API. |
My mistake, I had to define it myself, in mbedTLS :
Without modifying mbedTLS we could define mbedtls_data_pending as :
|
I don't think our own functions should use If the function is to be provided to other source files within libcurl it needs to be prefixed with |
Fixed my first point in 5446549 |
So if I understand you correctly, the patch would be something like this?
|
yes, exactly. |
It is not related but I also had to do this patch to use mbedtls debug
|
Thanks, I've pushed these commits now! |
I got an issue with libcurl after migrating from cyassl to mbedtls.
I configure my easy_handle to do a HTTPS POST than I call curl_easy_perform which locks and never returns. The same code works like a charm when using cyassl.
More precisely, with cyassl I can see that my write function (CURLOPT_WRITEFUNCTION) is called 2 times, one time for 212 bytes, and then for 9 bytes.
With mbedtls I receive the first call only. Sometimes the second call arrives after a long delay (several minutes).
Maybe it is the same bug than #334 ?
I use libcurl 7.47.1
The text was updated successfully, but these errors were encountered: