Skip to content

Commit 2fba92c

Browse files
Roytakmichalvasko
authored andcommitted
session openssl BUGFIX misleading error output
Fixes the output of the following: "[ERR]: Client certificate error (self-signed certificate in certificate chain)." even on successful authentication.
1 parent 8264f25 commit 2fba92c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/session_openssl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ nc_server_tls_verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx)
383383
/* copy the client cert */
384384
data->session->opts.server.client_cert = X509_dup(cert);
385385
NC_CHECK_ERRMEM_RET(!data->session->opts.server.client_cert, 0);
386+
387+
/* verification was successful, override the in-built verification result */
388+
X509_STORE_CTX_set_error(x509_ctx, X509_V_OK);
386389
}
387390
return 1;
388391
} else {

0 commit comments

Comments
 (0)