I looking for some help with creating https client. I saw many examples, all like this: https://github.com/ARMmbed/mbedtls/blob/development/programs/ssl/ssl_client1.c
( I based on this example but still have some problem with it)
I’m using k64f board, LwIP and mbedtls.
I have some connection with my server. I sent from my client the “Client Hello” message. Then my server answered “Server hello”, with certificate etc.
Unfortunately my client isn’t receiving this data and handshaking stops.
To make connections I use tcp_pcb *pcb, and tcp_connect function:
tcp_connect(pcb, &dest, HTTPS_PORT, client_connected);
I initialize of course (I think) all mbed ssl functions (among others):
After making connection i setting the callbacks:
mbedtls_ssl_set_bio(&ssl, pcb, my_mbedtls_net_send, my_mbedtls_net_recv, NULL);
With my “my_mbedtls_net_recv” and “my_mbedtls_net_send” functions.
Now my questions:
Why my my_mbedtls_net_recv isn’t receiving data?
( if I add my extra callback function like this:
static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
printf(“p->tot_len = %d”,p->tot_len);
“Server Hello” message is receiving by this function, but too late and not while handshaking (handshaking is already stopped)
How to direct data from liwp to the my_mbedtls_net_recv function?
I know it is little complicated,
Could You help me with it?