SSL Server only sends once and then throws error -5

davydnorris
Posts: 7
Joined: Sat May 20, 2017 9:46 am

SSL Server only sends once and then throws error -5

Postby davydnorris » Sat May 20, 2017 10:10 am

I have added SSL capability to the esphttpd project, and everything seems to be working fine in regular HTTP mode, but when I connect a client via HTTPS, the espconn_secure_send() function will only work the first time. The next time it fails to send with error -5 (ESPCONN_INPROGRESS).

Checking the recv callback and the connection state shows that the connection is fine and is not in progress. I'm using the latest NonOS SDK 2.1.0

This post has had exactly the same problem: http://bbs.espressif.com/viewtopic.php?f=16&t=3423

This is a debug dump of the esphttpd server callbacks and functions as I first try https://<server>/ (which redirects to /index.tpl), and then I try https://<server>/wifi (which goes to /wifi/wifi.tpl).

Code: Select all

server handshake start.
server handshake ok!
Conn... port = 443, state = 3
Conn req from  10.1.1.7:61075, using pool slot 0
ConS... port = 443, state = 3
Recv... port = 443, state = 5
URL = /
Is url index 0
Is url index 1
Pool slot 0 is done. Cleaning up for next req
RTSn... port = 443, state= 5
Sending... port = 443, len = 128, state= 4, ret = 0
Sent... port = 443, state = 3
Recv... port = 443, state = 5
URL = /index.tpl
Is url index 0
Is url index 3
Heatshrink compressed file; decode parms = b4
RTSn... port = 443, state= 5
Sending... port = 443, len = 99, state= 4, ret = -5
Disc... port = 443, state = 6
Pool slot 0: socket closed.
server handshake start.
server handshake ok!
Conn... port = 443, state = 3
Conn req from  10.1.1.7:61076, using pool slot 0
ConS... port = 443, state = 3
Recv... port = 443, state = 5
URL = /index.tpl
Is url index 0
Is url index 3
Heatshrink compressed file; decode parms = b4
RTSn... port = 443, state= 5
Sending... port = 443, len = 99, state= 4, ret = 0
Sent... port = 443, state = 3
RTSn... port = 443, state= 3
Sending... port = 443, len = 1024, state= 4, ret = -5
Disc... port = 443, state = 6
Pool slot 0: socket closed.
server handshake start.
server handshake ok!
Conn... port = 443, state = 3
Conn req from  10.1.1.7:61077, using pool slot 0
ConS... port = 443, state = 3
Recv... port = 443, state = 5
URL = /wifi/
Is url index 0
Is url index 9
Pool slot 0 is done. Cleaning up for next req
RTSn... port = 443, state= 5
Sending... port = 443, len = 136, state= 4, ret = 0
Sent... port = 443, state = 3
Recv... port = 443, state = 5
URL = /wifi/wifi.tpl
Is url index 0
Is url index 11
Heatshrink compressed file; decode parms = b4
RTSn... port = 443, state= 5
Sending... port = 443, len = 99, state= 4, ret = -5
Disc... port = 443, state = 6
Pool slot 0: socket closed.
server handshake start.
server handshake ok!
Conn... port = 443, state = 3
Conn req from  10.1.1.7:61078, using pool slot 0
ConS... port = 443, state = 3
Recv... port = 443, state = 5
URL = /wifi/wifi.tpl
Is url index 0
Is url index 11
Heatshrink compressed file; decode parms = b4
RTSn... port = 443, state= 5
Sending... port = 443, len = 99, state= 4, ret = 0
Sent... port = 443, state = 3
RTSn... port = 443, state= 3
Sending... port = 443, len = 1031, state= 4, ret = -5
Disc... port = 443, state = 6
Pool slot 0: socket closed.

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

Re: SSL Server only sends once and then throws error -5

Postby ESP_Faye » Sun May 28, 2017 10:19 am

Hi,

Can you provide the test code for debugging?

Thanks for your interest in ESP8266!

davydnorris
Posts: 7
Joined: Sat May 20, 2017 9:46 am

Re: SSL Server only sends once and then throws error -5

Postby davydnorris » Sun May 28, 2017 12:42 pm

Thanks Faye,

Replied to the Git Issue with test code. Let me know if you need anything else.

Who is online

Users browsing this forum: No registered users and 4 guests