diff options
-rw-r--r-- | openssl.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2986,10 +2986,10 @@ static int sx_new(lua_State *L) { static const char *opts[] = { "SSLv2", "SSLv3", "SSLv23", "SSL", "TLSv1", "TLS", NULL }; - SSL_CTX **ud = prepsimple(L, SSL_CTX_CLASS); /* later versions of SSL declare a const qualifier on the return type */ __typeof__(&TLSv1_client_method) method = &TLSv1_client_method; _Bool srv; + SSL_CTX **ud; lua_settop(L, 2); srv = lua_toboolean(L, 2); @@ -3015,6 +3015,8 @@ static int sx_new(lua_State *L) { break; } + ud = prepsimple(L, SSL_CTX_CLASS); + if (!(*ud = SSL_CTX_new(method()))) return throwssl(L, "ssl.context.new"); |