Skip to content

Commit

Permalink
apply patch recommended by daurnimator in issue #75
Browse files Browse the repository at this point in the history
  • Loading branch information
wahern committed Dec 10, 2016
1 parent 66326ec commit 670a112
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -8098,6 +8098,15 @@ static int ssl_getParam(lua_State *L) {
} /* ssl_getParam() */


static int ssl_getVerifyResult(lua_State *L) {
SSL *ssl = checksimple(L, 1, SSL_CLASS);
long res = SSL_get_verify_result(ssl);
lua_pushinteger(L, res);
lua_pushstring(L, X509_verify_cert_error_string(res));
return 2;
} /* ssl_getVerifyResult() */


static int ssl_getPeerCertificate(lua_State *L) {
SSL *ssl = checksimple(L, 1, SSL_CLASS);
X509 **x509 = prepsimple(L, X509_CERT_CLASS);
Expand Down Expand Up @@ -8287,6 +8296,7 @@ static const auxL_Reg ssl_methods[] = {
{ "clearOptions", &ssl_clearOptions },
{ "setParam", &ssl_setParam },
{ "getParam", &ssl_getParam },
{ "getVerifyResult", &ssl_getVerifyResult },
{ "getPeerCertificate", &ssl_getPeerCertificate },
{ "getPeerChain", &ssl_getPeerChain },
{ "getCipherInfo", &ssl_getCipherInfo },
Expand Down

0 comments on commit 670a112

Please sign in to comment.