mirror of
https://github.com/brunoos/luasec.git
synced 2024-11-07 22:18:27 +01:00
Return human readable error message from cert:issued()
This commit is contained in:
parent
d2c87d71f7
commit
97e836696b
@ -400,8 +400,13 @@ static int meth_issued(lua_State *L)
|
||||
{
|
||||
X509* issuer = lsec_checkx509(L, 1);
|
||||
X509* subject = lsec_checkx509(L, 2);
|
||||
lua_pushboolean(L, X509_check_issued(issuer, subject) == X509_V_OK);
|
||||
return 1;
|
||||
int ret = X509_check_issued(issuer, subject);
|
||||
lua_pushboolean(L, ret == X509_V_OK);
|
||||
if (ret != X509_V_OK) {
|
||||
lua_pushstring(L, X509_verify_cert_error_string(ret));
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user