diff options
author | Steven Barth <steven@midlink.org> | 2010-06-10 07:46:36 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2010-06-10 07:46:36 +0000 |
commit | 05a61e4632ade292d673c5237bafc03abd7531e0 (patch) | |
tree | ab076b73b079e17f7605fb052a48ea2acf4b17f0 /libs/nixio/src/tls-context.c | |
parent | 928099d53ce7d083d8110a079cd826803f33d2e4 (diff) |
nixio: Add set_verify_locations for TLS
Diffstat (limited to 'libs/nixio/src/tls-context.c')
-rw-r--r-- | libs/nixio/src/tls-context.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/nixio/src/tls-context.c b/libs/nixio/src/tls-context.c index 235a72382..e9a833f59 100644 --- a/libs/nixio/src/tls-context.c +++ b/libs/nixio/src/tls-context.c @@ -131,6 +131,14 @@ static int nixio_tls_ctx_set_cert(lua_State *L) { SSL_CTX_use_certificate_file(ctx, cert, ktype)); } +static int nixio_tls_ctx_set_verify_locations(lua_State *L) { + SSL_CTX *ctx = nixio__checktlsctx(L); + const char *CAfile = luaL_optstring(L, 2, NULL); + const char *CApath = luaL_optstring(L, 3, NULL); + return nixio__tls_pstatus(L, SSL_CTX_load_verify_locations(ctx, + CAfile, CApath)); +} + static int nixio_tls_ctx_set_key(lua_State *L) { SSL_CTX *ctx = nixio__checktlsctx(L); const char *cert = luaL_checkstring(L, 2); @@ -203,6 +211,7 @@ static const luaL_reg R[] = { /* ctx function table */ static const luaL_reg CTX_M[] = { {"set_cert", nixio_tls_ctx_set_cert}, + {"set_verify_locations", nixio_tls_ctx_set_verify_locations}, {"set_key", nixio_tls_ctx_set_key}, {"set_ciphers", nixio_tls_ctx_set_ciphers}, {"set_verify", nixio_tls_ctx_set_verify}, |