MbedTLS failing with "The certificate is not correctly signed by the trusted CA" (0x08) connecting to Google Cloud load balancer

I don’t have a handshake. Specifically, the problem is described here:
https://forums.mbed.com/t/mbedtls-ssl-handshake-return-error-0x2700/5354

The function

static int function x509_crt_merge_flags_with_cb (x509_crt.c)

returns the value 8 in the flags variable. I went through this function step by step and saw that cur_flags was assigned the value 8 in the line

cur_flags = cur->flags;

. I don’t know where value 8 came from in cur->flags. Since the condition

if( NULL != f_vrfy )

fails (f_vrfy = 0), the

if( ( ret = f_vrfy( p_vrfy, cur->crt, (int) i-1, &cur_flags ) ) != 0 )

line is not called. Probably p_vrfy is not registered? Where does the value 8 come from in cur->flags;?