-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Add experimental SSL to host emulator using axtls-8266 #1852
Conversation
Don't need replacements/time.c for host build, select via component.mk Update axtls-8266 patch file: * vprintf -> m_vprintf * putc -> m_putc and ensure `putc`macro is undefined * Remove replacements/libc.c
…` to be non-null. Ensure code has separate null checks.
…s deleted by HttpRequest::reset() If we wanted to do this sort of thing we'd either need an additional flag to indicate stream ownership, use a shared_ptr, or some other mechanism.
Works OK under Windows, but in Linux I'm getting memory allocation errors. Some assistance in tracking this down would be much appreciated! Testing using the
|
Calling
|
Note: I'm building with |
@mikee47(Not directly related to this thread) I can see that you are testing / developing on Windows. At the same time Windows is only officially supported up to SDK 1.5. Getting Started: Linux/Windows on https://sming.readthedocs.io
My
Shows lots of messages similar to
However checking gcc version is still the same: Thanks |
@icodk Looks like it's not picking gcc up from the right location. Maybe check your path is correct?
|
I have compiled Basic_Ssl sample using the following command:
After that added Spiffs with
And ran the code using valgrind
There were no reported issues or memory leaks. But also the current Basic_Ssl sample was not doing much because a HEAD request was sending 302 redirection. So I changed the application code to send a GET request and ran the code again under valgrind. The application crashed.
You can put a debug breakpoint at lwip_compat.c line 138. My wild guess is that lwip_compat is not handling correctly multiple SSL packets inside one TCP packet. In the host arch our network buffer is bigger than the one in esp8266. The following debug messages need to be investigated:
I will keep you posted when I find something more... |
SSL under host emulator on Linux works for some URLs. For example: https://x.attachix.com and https://google.com. For others it correctly displays wrong handshake (https://attachix.com for example - does not accept the algorithms that are coming with axTLS).
The handling of multiple SSL packets works as expected. The interesting question is why Host LWIP2 + axTLS fails with https://www.grc.com/fingerprints.htm. I tried to debug it and I can see that at some point the remote server does not send all expected data and the client gets stuck. Have to compare network traffic to see what is going on, but that probably will not be today... |
@mikee47 I looked more closely at your backtrace: I don't have the problem that you are reporting. Why don't you try to run app the using the KataCoda Env: https://www.katacoda.com/slaff/scenarios/sming-host-emulator ? |
@slaff Thanks for the feedback. I get a strong feeling that the heap is getting corrupted somewhere else, will probably stumble across it when I'm not looking! |
@mikee47
|
@icodk It's the second one you need so that should go first. |
@mikee47 Now I get
and version :
Running
and then
Any idea what and how to get the new compiler ? |
@icodk You're using the https://sourceforge.net/projects/mingw-w64/ project. For this, we need the original 32-bit MinGW which you can find here https://osdn.net/projects/mingw/releases/68260 (obtained via http://www.mingw.org/). |
@icodk Have you had any success yet? |
@mikee47 I managed to install the new (est?) compiler:
It was a bit tricky because
Renaming
Where can I tell make which compile to use. It obviously not looking in the path or am I missing something ? |
Quite a bit has changed from version 3.8, so may I suggest compiling the |
@mikee47 I am actually using SDK 1.5.3(aec24ac9) and Sming: 2.1.0. |
@icodk See https://sming.readthedocs.io/en/latest/arch/esp8266/getting-started/windows.html. As it states, Windows uses the 'unofficial development kit' (UDK)The SDK for Windows is known as the UDK, pre-built and provides similar functionality. Interestingly though, espressif GCC is version 6.3 for that but only 4.8 under Linux. I run Windows 10 as my main development system, with Ubuntu under VirtualBox. The GIT repos are on Windows, accessed via shared drives under Linux. BUT I use separate worktrees and checkin/checkout to sync the two. Hence, separate environments for both. Works very well. To use SDK 3.0.1 see https://sming.readthedocs.io/en/latest/_inc/Sming/Arch/Esp8266/Components/esp8266/index.html. |
@mikee47 Thanks for the information. I will look at it in the coming days and let you know. |
No description provided.