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