SSL Connect.
SSL Connect.
Postby younger » Sun Jan 04, 2015 10:59 am
Hi ,
I have connected to a ssl server, but it is always failed. The ip and port is 111.206.227.37:2001.
I want to have SSL_connect succeed even if verifying the server fails and reducing security, may like "SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0)" in cyassl.
How to do like this in ESP8266 sdk ?
I have connected to a ssl server, but it is always failed. The ip and port is 111.206.227.37:2001.
I want to have SSL_connect succeed even if verifying the server fails and reducing security, may like "SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0)" in cyassl.
How to do like this in ESP8266 sdk ?
Re: SSL Connect.
Postby younger » Sun Jan 04, 2015 2:09 pm
Espressif_Faye wrote:It seems that SSL certificate of your server is not correct, so the connecting fails.
What do you want to do?
The server is JD-Cloud server ,I just use ESP8266 to connect it,but it is fail.
But another code in cyassl "CyaSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0)" will be OK, and the SSL_VERIFY_NONE seems ignored the verify result to ensure the connect suuceed.
In ESP8266 use axtls for ssl, how can I achieve it for SSL_VERIFY_NONE? Maybe I must transplant cyassl instead of axtls in ESP8266?
Re: SSL Connect.
Postby younger » Mon Jan 05, 2015 10:20 am
Espressif_Faye wrote:Please try this:
Hi Espressif_Faye,
Does it work after modify this code?
I have tried this but still fail.
Code: Select all
ip:192.168.1.126,mask:255.255.255.0,gw:192.168.1.1
user_esp_platform_dns_found 111.206.227.37
user_esp_platform_connect
espconn_ssl_connect 0x3fff5a00 0x3fff59a0 0x00006338 1073699992
client handshake start.
espconn_ssl_client ssl_ctx 0x3fff5cf0
send_raw_packet pkt_size 56
send_raw_packet Length 56
espconn_ssl_csent 0x3fff5a00 0x3fff5dbc 56
espconn_ssl_crecv 409 0x3fff5d90 0x3fff5978
do_clnt_handshake: 107 2
do_clnt_handshake: 107 11
Error: Invalid X509 ASN.1 file (X509 not ok)
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
user_esp_platform_reconnect
Re: SSL Connect.
Postby ESP_Faye » Mon Jan 05, 2015 2:04 pm



Sorry.. Please change it back..
int ICACHE_FLASH_ATTR asn1_validity(const uint8_t *cert, int *offset, X509_CTX *x509_ctx)
{
return (asn1_next_obj(cert, offset, ASN1_SEQUENCE) < 0 ||
asn1_get_utc_time(cert, offset, &x509_ctx->not_before) ||
asn1_get_utc_time(cert, offset, &x509_ctx->not_after));
}
And try this..
- Attachments
-
- ssl_modify_2.png (16.99 KiB) Viewed 11793 times
Re: SSL Connect.
Postby younger » Mon Jan 05, 2015 2:15 pm
Espressif_Faye wrote::o![]()
![]()
Sorry.. Please change it back..
int ICACHE_FLASH_ATTR asn1_validity(const uint8_t *cert, int *offset, X509_CTX *x509_ctx)
{
return (asn1_next_obj(cert, offset, ASN1_SEQUENCE) < 0 ||
asn1_get_utc_time(cert, offset, &x509_ctx->not_before) ||
asn1_get_utc_time(cert, offset, &x509_ctx->not_after));
}
And try this..

Who is online
Users browsing this forum: No registered users and 91 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.