Skip to content
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

Possibility to change mbedtls_ssl_conf_read_timeout #101

Closed
1 of 2 tasks
sebachm94 opened this issue Jan 3, 2024 · 7 comments
Closed
1 of 2 tasks

Possibility to change mbedtls_ssl_conf_read_timeout #101

sebachm94 opened this issue Jan 3, 2024 · 7 comments

Comments

@sebachm94
Copy link
Contributor

NOTE: Please use stackoverflow for support questions.
This repository's issues are reserved for feature requests and bug reports.

I am submitting a …

  • bug report
  • feature request

Description

I'm using yours library to communicate with some embedded device with low resources power, so some calculation takes some time(2-4sec).
I would like to have possibility to set up the response time, because I noticed it's set up to 1s by default (correct me if I'm wrong).
There is mbedtls_ssl_conf_read_timeout function to set up the desired value, would it be possible to add support for it?

Current behavior

Can't handle answers which comes after 1sec.
image

Expected behavior

It's possible to set up read timeout.

@Synss
Copy link
Owner

Synss commented Jan 3, 2024

That makes sense and looks easy enough. Do you want to prepare a PR? Otherwise I can most likely add the binding in the next few days.

@sebachm94
Copy link
Contributor Author

Sure, I will try to make it today, so you can review or help if there will be some problems.

@Synss
Copy link
Owner

Synss commented Jan 5, 2024

Looks good. I've merged your commit and will make a new release. BTW: Did it solve your issue?

PR #102

@Synss Synss closed this as completed Jan 5, 2024
@sebachm94
Copy link
Contributor Author

Yes, it does. Thanks a lot for quick support :)

Btw, I have a question, maybe it's something I don't understand or don't know how to configure.
My cert chain is > 1024B long in total
and while trying to send it only up to 1024 bytes are send, there is something I need to configure to split packets into smaller parts?

It's send here:
image

@Synss
Copy link
Owner

Synss commented Jan 6, 2024

I'd expect larger chains to work as well because it's in the while loop (line 438). If the stream is incomplete, do_handshake (line 440) should raise WantReadError or WantWriteError and the loop proceeds the next chunk. If that's not the case, then it's a bug.

The internal buffers are 32K.

@sebachm94
Copy link
Contributor Author

Looks like it sends only first chunk.
At least in my case. I also tried to lower the MCU but it didn't helped too.
And it looks like it changes state to WantToRead.

@Synss
Copy link
Owner

Synss commented Jan 9, 2024

I’ll have a look. It should be easy to test or simulate. Could you open a different issue for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants