Openssl : error “self signed certificate in certificate chain”?

When I used openssl APIs to validate server certificate (self signed), I got following error : error 19 at 1 dep...