---
title: "Stuck in while \"handshake\"."
url: "https://maker.wiznet.io/forum/14844"
markdown_url: "https://maker.wiznet.io/forum/14844/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Alex1396"
created: "2023-03-26T23:07:33+09:00"
last_activity: "2023-09-06T06:57:03+09:00"
language: "en"
views: 386
replies: 0
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Stuck in while "handshake".

## Question

Asked by Alex1396 on 2023-03-26 in Ethernet Chips.

Hello friends! I’m trying set the SSL connection with mbedTLS library with W5500 on STM32F767. I’m using your example and files from github ([GitHub - Wiznet/ioLibrary_Driver: ioLibrary_Driver can be used for the application design of WIZnet TCP/IP chips as W5500, W5300, W5200, W5100 W5100S.](https://github.com/Wiznet/ioLibrary_Driver)). And i’m using Hardware RNG else. Socket open is sucess, connection to the server sucess next. While “handshake” i receive last messahe: “in_left: 0, nb_want: 5” and my programm don’t go next. I found out that programn stuck in recv() function in while() operator. recvsize always equal 0, getSn_RX_RSR(sn) function always return 0. What may be the problem? Why don’t work timeout break? Have is it here an implementation?

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/f/f1631bc8a0ff1d1cdd9b56bcab96134d17a50764.png) image767×434 16 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/f/f1631bc8a0ff1d1cdd9b56bcab96134d17a50764.png)

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/8e78140b29032842abded879903abe9e3d273660.png) image780×274 7.04 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/8e78140b29032842abded879903abe9e3d273660.png)

My DEBUG messages:

Start
Calling DHCP_run()…

=== W5500 NET CONF : DHCP ===
MAC: EA:11:22:33:44:EA
SIP: 192.168.21.6
GAR: 192.168.21.1
SUB: 255.255.255.0
DNS: 192.168.21.1

mbedtls_ctr_drbg_seed Ok!
Loading the CA root certificate
x509_crt_parse Ok!
. Setting up the SSL/TLS structure…
mbedtls_ssl_config_defaults Ok!
mbedtls_ssl_setup Ok!
mbedtls_ssl_set_hostname Ok!
Calling DNS_init()…
Resolving domain name “[fallin.ru](http://fallin.ru)”…
Result: 188.124.41.188
Socket open ok! Connection to the [fallin.ru](http://fallin.ru) ok! . Performing the SSL/TLS handshake…=> handshake

=> flush output

&lt;= flush output

client state: MBEDTLS_SSL_HELLO_REQUEST

=> flush output

&lt;= flush output

client state: MBEDTLS_SSL_CLIENT_HELLO

=> write client hello

=> write handshake message

=> write record

&lt;= write record

&lt;= write handshake message

&lt;= write client hello

=> flush output

message length: 64, out_left: 64

ssl->f_send() returned 64 (-0xffffffc0)

&lt;= flush output

client state: MBEDTLS_SSL_SERVER_HELLO

=> parse server hello

=> read record

=> fetch input

in_left: 0, nb_want: 5

---

Source: https://maker.wiznet.io/forum/14844
