-
Notifications
You must be signed in to change notification settings - Fork 396
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
Correct ssl recv #129
base: master
Are you sure you want to change the base?
Correct ssl recv #129
Conversation
Update fork with master
Syncing with me-no-dev repo
Syncing with upstream
…rver::_poll(). And other missed edit for errorTracker around ASYNC_TCP_SSL_ENABLED. This should resolve @kasedy comment me-no-dev#115 (comment) and @mcspr. Tested ASYNC_TCP_SSL_ENABLED using marvinroger/async-mqtt-client/ .. examples/FullyFeaturedSSL. Ran test against test.mosquitto.org's server. Thanks to @mcspr for suggesting. Updated tcp_ssl_read() to check for fd_data being freed by callback functions. I observed this with asyncmqttclient example. When finger print did not match during fd_data->on_handshake callback, the mqtt library did a close(true) which rippled down to an tcp_ssl_free(). Improvements in debug printing to handle debug print from tcp.axtls.c.
I tested this code, it compiles but doesn't seem to work with https://github.com/marvinroger/async-mqtt-client. I get the following logging: On the mqtt server I can see this in the log: When not using SSL it just works fine... What can this be? |
This is the result I get going to "test.mosquitto.org"
|
Maybe it's because of different option configured (I use setwill for example). Still strange, because in your logging you get response from the MQTT server while in my example, no response is received. I will try without setwill. |
Ok, your code is working. I bumped into this bug: marvinroger/async-mqtt-client#107 |
I solved the bug in async-mqtt-client. MQTT with SSL with your code works fine now. |
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.
Tested with async-mqtt-client and it works
The best way to solve this completely imo is to change the code, create a addtobuffer and a sendbuffer function and send 1 packet instead of multiple in all current functions. But I don't have time at the moment to do this. |
I ran into issues when compiling an esphome project depending on ESPAsyncTCP with SSL enabled. This PR solved the issues. Thanks! (Thanks as well for the hint on the MQTT bug, I ran into it as well..., but again your PR in the other repo fixes it) |
@me-no-dev ESPAsyncTCP latest doesn't compile with SSL enabled. |
I have the same compilation problems and ESPAsyncTCP works with this pull request with SSL without any problems yet. I would appreciate a merge, too. |
@mhightower83 it would be good, to rebase your fix on the master branch instead of merging the master branch into your branch. |
@me-no-dev ESPAsyncTCP latest doesn't compile with SSL enabled. |
how can I dowonload this pull request? @jeroenst |
With PlatformIO you can do in
|
Hey jeroenst. Could you please elaborate how did you manage to get this working: |
@gecoool I use arduino ide with esp8266 board version 2.7.4 |
Corrected missed edit for _recv() in ASYNC_TCP_SSL_ENABLED in AsyncServer::_poll().
And other missed edit for
errorTracker
around ASYNC_TCP_SSL_ENABLED.This should resolve @kasedy comment #115 (comment) and @mcspr.
Tested ASYNC_TCP_SSL_ENABLED using marvinroger/async-mqtt-client/ ... examples/FullyFeaturedSSL. Ran test against test.mosquitto.org's server. Thanks to @mcspr for suggesting.
Updated tcp_ssl_read() to check for fd_data being freed by callback functions. I observed this with asyncmqttclient example. When fingerprint did not match during fd_data->on_handshake callback, the MQTT library did a close(true) which rippled down to a tcp_ssl_free().
Improvements in debug printing to handle debug print from tcp.axtls.c.