aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2018-07-20 13:04:11 +1000
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2018-07-20 13:44:20 +1000
commitd19dc1efbab219a1ccd673c7c1da4702332ea3a7 (patch)
tree85a35268e5a8a37893713c084957fffdb79f2428 /src
parent162c872aecab9068e752805d36aae63ec4ae24ce (diff)
downloadluaossl-d19dc1efbab219a1ccd673c7c1da4702332ea3a7.tar.gz
luaossl-d19dc1efbab219a1ccd673c7c1da4702332ea3a7.tar.bz2
luaossl-d19dc1efbab219a1ccd673c7c1da4702332ea3a7.zip
src/openssl.c: Bind SSL_get_SSL_CTX as ssl:getContext()
Diffstat (limited to 'src')
-rw-r--r--src/openssl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c
index f1feebf..102408e 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -9262,6 +9262,18 @@ static int ssl_setContext(lua_State *L) {
return 1;
} /* ssl_setContext() */
+
+static int ssl_getContext(lua_State *L) {
+ SSL *ssl = checksimple(L, 1, SSL_CLASS);
+
+ SSL_CTX *ctx = SSL_get_SSL_CTX(ssl);
+
+ sx_push(L, ctx);
+
+ return 1;
+} /* ssl_getContext() */
+
+
static int ssl_setOptions(lua_State *L) {
SSL *ssl = checksimple(L, 1, SSL_CLASS);
auxL_Integer options = auxL_checkinteger(L, 2);
@@ -9768,6 +9780,7 @@ static int ssl__gc(lua_State *L) {
static const auxL_Reg ssl_methods[] = {
{ "setContext", &ssl_setContext },
+ { "getContext", &ssl_getContext },
{ "setOptions", &ssl_setOptions },
{ "getOptions", &ssl_getOptions },
{ "clearOptions", &ssl_clearOptions },