Hello! I set up a verification callback with SSL_CTX_set_verify. Both my client and server use simple self-signed certificates. The problem is: when they connect, the verification callback is called twice. My guess was that it was called for the peer certificate and then for the CA, but when i request the certificate with X509_STORE_CTX_get_current_cert, it gives the same one both times. Maybe it's becouse the certificate is self signed? But they should be different anyway, shouldn't they? I tried to change the behaviour with SSL_CTX_set_verify_depth and SSL_set_verify_depth setting depth to zero but it didn't work (i didn't really understood what they do). I just want to verify a single certificate (the peer's one) for each connection.
Thanks.