ESP8266 Developer Zone The Official ESP8266 Forum 2015-04-22T11:50:00+08:00 https://bbs.espressif.com:443/feed.php?f=66&t=385 2015-04-22T11:50:00+08:00 2015-04-22T11:50:00+08:00 https://bbs.espressif.com:443/viewtopic.php?t=385&p=1467#p1467 <![CDATA[Re: SSL compile error]]>
Thanks for your interest in ESP8266,

Please have a try with the demo code here http://bbs.espressif.com/viewtopic.php?f=21&t=389
Notice that there is a SSL patch http://bbs.espressif.com/viewtopic.php?f=5&t=382

In your case, you need to only change the IP , port and buffer size in user_check_ip , just as below

Code:

       const char esp_server_ip[4] = {96, 114, 157, 81};

       os_memcpy(user_tcp_conn.proto.tcp->remote_ip, esp_server_ip, 4);

       user_tcp_conn.proto.tcp->remote_port = 465; // remote SSL port of tcp server
     
       user_tcp_conn.proto.tcp->local_port = espconn_port(); //local port of ESP8266

       espconn_regist_connectcb(&user_tcp_conn, user_tcp_connect_cb); // register connect callback
       espconn_regist_reconcb(&user_tcp_conn, user_tcp_recon_cb); // register reconnect callback as error handler

       espconn_secure_set_size(ESPCONN_CLIENT,5120); // set SSL buffer size, if your SSL packet larger than 2048
       espconn_secure_connect(&user_tcp_conn); // tcp SSL connect


Please have a try and let me know if your problem be solved or not ?

Statistics: Posted by ESP_Faye — Wed Apr 22, 2015 11:50 am


]]>
2015-04-22T11:20:30+08:00 2015-04-22T11:20:30+08:00 https://bbs.espressif.com:443/viewtopic.php?t=385&p=1464#p1464 <![CDATA[Re: SSL compile error]]>
Her Majesty wrote:
Can this SSL demo help ? http://bbs.espressif.com/viewtopic.php?f=7&t=386


that is just a copy of the iot example, lol. no it won't help the original poster because it is not an AT command extension
have you actually tried using the ssl api?

Statistics: Posted by doughboy — Wed Apr 22, 2015 11:20 am


]]>
2015-04-22T10:53:04+08:00 2015-04-22T10:53:04+08:00 https://bbs.espressif.com:443/viewtopic.php?t=385&p=1461#p1461 <![CDATA[Re: SSL compile error]]> http://bbs.espressif.com/viewtopic.php?f=7&t=386

Statistics: Posted by Her Mary — Wed Apr 22, 2015 10:53 am


]]>
2015-04-21T23:53:18+08:00 2015-04-21T23:53:18+08:00 https://bbs.espressif.com:443/viewtopic.php?t=385&p=1451#p1451 <![CDATA[Re: SSL compile error]]>
unsigned char *default_certificate;
unsigned int default_certificate_len = 0;
unsigned char *default_private_key;
unsigned int default_private_key_len = 0;

if you are using server, you can generate your own self signed certificate and private key using openssl command line. You will also need xxd (this is in tools folder).
I use the following commands
openssl genrsa -out private.key 384
openssl req -new -x509 -key private.key -out server.cert -days 3650 -subj /CN=<yourname>
openssl enc -d -a -in private.key -out private.bin
openssl enc -d -a -in server.cert -out cert.bin
xxd -i private.bin > private.h
xxd -I cert.bin > cert.h
then change the variable names in the *.h files to the appropriate name.


BTW, I am trying to add SSL AT commands and it seems none of the SSL api works, at least when connecting to real world servers using real certificates like gmail.com, etc. even with 8k buffer.

Statistics: Posted by doughboy — Tue Apr 21, 2015 11:53 pm


]]>
2015-04-21T16:00:00+08:00 2015-04-21T16:00:00+08:00 https://bbs.espressif.com:443/viewtopic.php?t=385&p=1445#p1445 <![CDATA[Re: SSL compile error]]>
Thanks for your interest in ESP8266 !

These are defined in cert.h and private_key.h in IOT_Demo.

Statistics: Posted by ESP_Faye — Tue Apr 21, 2015 4:00 pm


]]>
2015-04-21T12:04:27+08:00 2015-04-21T12:04:27+08:00 https://bbs.espressif.com:443/viewtopic.php?t=385&p=1442#p1442 <![CDATA[SSL compile error]]> i add the ssl library to my project, but it is some compiler error

../lib/libssl.a(ssl_loader.o): In function `ssl_obj_free':
(.irom0.text+0x4c0): undefined reference to `default_private_key'
../lib/libssl.a(ssl_loader.o): In function `ssl_obj_free':
(.irom0.text+0x4c4): undefined reference to `default_private_key_len'
../lib/libssl.a(ssl_loader.o): In function `ssl_obj_free':
(.irom0.text+0x4c8): undefined reference to `default_certificate_len'
../lib/libssl.a(ssl_loader.o): In function `ssl_obj_free':
(.irom0.text+0x4cc): undefined reference to `default_certificate'
collect2: error: ld returned 1 exit status
make: *** [.output/eagle/debug/image/eagle.app.v6.out] Error 1


please give me some advice,thanks!

Statistics: Posted by AlonX — Tue Apr 21, 2015 12:04 pm


]]>