aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/openssl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 4564061..78ab3a0 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -7609,7 +7609,13 @@ static SSL *ssl_push(lua_State *L, SSL *ssl) {
} /* ssl_push() */
static int ssl_new(lua_State *L) {
- lua_pushnil(L);
+ SSL_CTX *ctx = checksimple(L, 1, SSL_CTX_CLASS);
+ SSL **ud = prepsimple(L, SSL_CLASS);
+
+ *ud = SSL_new(ctx);
+
+ if (!*ud)
+ return auxL_error(L, auxL_EOPENSSL, "ssl.new");
return 1;
} /* ssl_new() */