diff --git a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c index af3bf6ee605657a7c6704a6e82c004582420d5d2..a57e4d9142285c4a535b144f76c63cfb044036d8 100644 --- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c +++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c @@ -1421,10 +1421,8 @@ static SslEndPoint_t * NewSslEndPoint(const CAEndpoint_t * endpoint, mbedtls_ssl tep->sep.endpoint = *endpoint; tep->sep.endpoint.flags = (CATransportFlags_t)(tep->sep.endpoint.flags | CA_SECURE); - if (g_getIdentityCallback != NULL) - { - mbedtls_ssl_conf_verify(config, verifyIdentity, NULL); - } + mbedtls_ssl_conf_verify(config, g_getIdentityCallback ? verifyIdentity : NULL, NULL); + if(0 != mbedtls_ssl_setup(&tep->ssl, config)) { OIC_LOG(ERROR, NET_SSL_TAG, "Setup failed");