ESP8266 Developer Zone The Official ESP8266 Forum 2015-01-04T13:47:21+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=62 2015-01-04T13:47:21+08:00 2015-01-04T13:47:21+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=429#p429 <![CDATA[Re: espconn_secure_connect: how does it work?]]> It seems that SSL certificate of your server is not correct :?:

Statistics: Posted by ESP_Faye — Sun Jan 04, 2015 1:47 pm


]]>
2015-01-02T15:51:32+08:00 2015-01-02T15:51:32+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=419#p419 <![CDATA[Re: espconn_secure_connect: how does it work?]]>
jackon wrote:
Here is the patch, we test to connect your server, it works OK, you can check by yourself.
Just extra the libssl.a to SDK's lib folder.

Or you can modify ssl_tls1.h, line 80.

Code:

#define RT_MAX_PLAIN_LENGTH 4096


Give me feedback after your test.
Thx

Hi jackon,
I use the patch and in SDK 0.9.5_b1 to connect ssl server(111.206.227.37:2001), still find some problems:

Code:

connected with LU, channel 6
dhcp client start...
ip:192.168.2.114,mask:255.255.255.0,gw:192.168.2.1
user_esp_platform_dns_found 111.206.227.37
user_esp_platform_connect
espconn_ssl_connect 0x3fff5a30 0x3fff59d0 25352
client handshake start.
espconn_ssl_client ssl_ctx 0x3fff5d20
send_raw_packet pkt_size 56
send_raw_packet Length 56
espconn_ssl_csent 0x3fff5a30 0x3fff5dec 56
espconn_ssl_crecv 409 0x3fff5dc0 0x3fff59a8
basic_read 1366 16 0x00000000
do_clnt_handshake: 107 2
do_clnt_handshake: 107 11
Error: Invalid X509 ASN.1 file (X509 not ok)
[D],process_certificate,x509_new
send_raw_packet pkt_size 7
send_raw_packet Length 7
client handshake failed
espconn_ssl_cclose 0
espconn_ssl_cclose_cb 10 0
send_raw_packet pkt_size 7
send_raw_packet Length 7
user_esp_platform_discon_cb


Could you help me to slove the problems ? This is very important to me.
Thanks!

Statistics: Posted by younger — Fri Jan 02, 2015 3:51 pm


]]>
2014-12-03T17:49:15+08:00 2014-12-03T17:49:15+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=240#p240 <![CDATA[Re: espconn_secure_connect: how does it work?]]>
I had the same problem when connecting to 'official signed' HTTPS servers. After changing the buffersize to 4096 instead of 1024, the HTTPS connection works fine now!

Thanks!

Statistics: Posted by mathijs — Wed Dec 03, 2014 5:49 pm


]]>
2014-11-29T16:29:28+08:00 2014-11-29T16:29:28+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=228#p228 <![CDATA[Re: espconn_secure_connect: how does it work?]]>
Ah, while I'm asking questions about SSL etc, does the SDK already have a method to do opportunistic TLS? That basically involves setting up a plaintext connection, asking the server if you can continue using encryption and then doing the SSL handshake over the same socket you previously did plaintext over. If not, I may implement it myself.

Statistics: Posted by ESP_Sprite — Sat Nov 29, 2014 4:29 pm


]]>
2014-11-28T21:36:02+08:00 2014-11-28T21:36:02+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=227#p227 <![CDATA[Re: espconn_secure_connect: how does it work?]]> Just extra the libssl.a to SDK's lib folder.

Or you can modify ssl_tls1.h, line 80.

Code:

#define RT_MAX_PLAIN_LENGTH 4096


Give me feedback after your test.
Thx
libssl.zip

Statistics: Posted by jackon — Fri Nov 28, 2014 9:36 pm


]]>
2014-11-28T19:44:34+08:00 2014-11-28T19:44:34+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=226#p226 <![CDATA[Re: espconn_secure_connect: how does it work?]]> I'd really like a patch for 0.9.3 to try! Thanks for looking into the problem.

Statistics: Posted by ESP_Sprite — Fri Nov 28, 2014 7:44 pm


]]>
2014-11-28T17:03:06+08:00 2014-11-28T17:03:06+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=224#p224 <![CDATA[Re: espconn_secure_connect: how does it work?]]> Which version SDK do you use now?
I'll give your a patch for test.

Statistics: Posted by jackon — Fri Nov 28, 2014 5:03 pm


]]>
2014-11-28T16:29:23+08:00 2014-11-28T16:29:23+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=223#p223 <![CDATA[Re: espconn_secure_connect: how does it work?]]>
jackon wrote:
hi, Sprite_tm
Could you provide your SSL server's ip and port?
We will have a test.


Sure. I've tried it on two servers, both my HTTPS as well as a SSL Jabber server I don't manage myself. Connecting to the https server makes the esp reboot, connecting to the Jabber server stalls the connection. Both connect fine using for example openssl s_client -connect spritesmods.com:443
The https server is at
https://spritesmods.com/ (port 443, as usual)
The jabber server I tried is at
jabber.hot-chilli.net:5223

Statistics: Posted by ESP_Sprite — Fri Nov 28, 2014 4:29 pm


]]>
2014-11-28T12:53:20+08:00 2014-11-28T12:53:20+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=222#p222 <![CDATA[Re: espconn_secure_connect: how does it work?]]> Could you provide your SSL server's ip and port?
We will have a test.

Statistics: Posted by jackon — Fri Nov 28, 2014 12:53 pm


]]>
2014-11-28T06:20:29+08:00 2014-11-28T06:20:29+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=221#p221 <![CDATA[Re: espconn_secure_connect: how does it work?]]>
That's all somewhat unfortunate: it makes it pretty much impossible to use SSL for anything but services that are specifically meant for the ESP. Ah well, for three bucks, I still can't complain.

Statistics: Posted by ESP_Sprite — Fri Nov 28, 2014 6:20 am


]]>
2014-11-27T07:24:26+08:00 2014-11-27T07:24:26+08:00 https://bbs.espressif.com:443/viewtopic.php?t=62&p=218#p218 <![CDATA[espconn_secure_connect: how does it work?]]>
I'm developing an application that needs to connect to a SSL server (specifically, an XMPP server), but I'm running into trouble with espconn_secure_connect and friends. When I use espconn_connect, everything works, but with espconn_secure_connect, I either get
"client handshake start."
on the console and then nothing, or an exception:
"Fatal exception (29):
epc1=0x4000df3a, epc2=0x00000000, epc3=0x00000000, excvaddr=0x181869fe, depc=0x00000000"
What I get is dependent on the server I connect to.

Just to check: do I need something valid in cert.h and/or private_key.h? At the moment, I have what I think is a self-signed certificate in those files, but I couldn't really find any documentation on those. I also don't quite know if they're needed for a client-side connection. Could you shed some light on those things?

Statistics: Posted by ESP_Sprite — Thu Nov 27, 2014 7:24 am


]]>