Does anyone have an HTTPS server running?

blubb
Posts: 94
Joined: Mon Jun 22, 2015 5:35 am

Does anyone have an HTTPS server running?

Postby blubb » Mon Nov 06, 2017 2:27 am

I mean, in a usable state, i.e. one can access html pages that load images, css, js and so on? I have no problems at all with a HTTP server (based on the esp-link project), but HTTPS is a real pain. As long as I make one access at a time, there seems to be no problem. But accessing twice with too short a delay in between results in some kind of freeze. There is no exception, no error message*, but the server won't respond until reboot. Which is annoying, of course.



* besides the usual

server's data invalid protocol
Reason:[-0x7880]

that happens all the time.

Her Majesty
Posts: 229
Joined: Mon Oct 27, 2014 11:09 am

Re: Does anyone have an HTTPS server running?

Postby Her Majesty » Mon Nov 06, 2017 2:01 pm

I have some simple examples, not sure if it can help. I have added it as the attachment.
Attachments
SSL_Test.zip
(3.72 MiB) Downloaded 16 times

blubb
Posts: 94
Joined: Mon Jun 22, 2015 5:35 am

Re: Does anyone have an HTTPS server running?

Postby blubb » Mon Nov 06, 2017 10:18 pm

Hi,

thanks. That is indeed a very simple demo. I am going to test if the same problem occurs.
Is that the standard mbedtls and lwip that is also included in the SDK (as lib) or did you make some modifications?

blubb
Posts: 94
Joined: Mon Jun 22, 2015 5:35 am

Re: Does anyone have an HTTPS server running?

Postby blubb » Tue Nov 07, 2017 7:36 am

Ok, using the code you provided and the mbedtls lib from the current SDK (master branch) I get the same results: First it works. But after hitting F5 repeatedly in the browser the server hangs. Now I at least get error messages (I added the missing espconn_regist_reconcb):

Code: Select all

E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
E:M 1584
E:M 1584
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
E:M 1584
E:M 1584
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!


The server does not recover from this state. I have to reboot.

Can you please try if this happens for you, too?

Edit: I can even provoke an exception by hitting F5 fast enough. LoadProhibitedCause. According to map file it is somewhere in recv_tcp in libmbedtls.a

Edit: Exceptions can also be in tcp_recved or ringbuf_memcpy_into (both in liblwip.a).

ESP_Faye
Posts: 1632
Joined: Mon Oct 27, 2014 11:08 am

Re: Does anyone have an HTTPS server running?

Postby ESP_Faye » Thu Dec 14, 2017 6:59 pm

Hi,

Please have a try with the ESP8266_NONOS_SDK commit a1fa90.

And add espconn_tcp_set_max_con(1); on your demo.

If your problem is still unsolved, please feel free to let us know.

Thanks.

blubb
Posts: 94
Joined: Mon Jun 22, 2015 5:35 am

Re: Does anyone have an HTTPS server running?

Postby blubb » Thu Dec 14, 2017 8:00 pm

The new SDK works when limited to only 1 connection, yes. Thanks. However, I gave up the endeavor since it does not work with standard browsers. They need more connections. There is too little heap in those tiny chips I'm afraid.

Who is online

Users browsing this forum: Bing [Bot], jinjack and 9 guests