Skip to content

Instantly share code, notes, and snippets.

@Zenithar
Last active May 18, 2017 15:07
Show Gist options
  • Save Zenithar/8850e946836b2d3bd3aae794a534ce1e to your computer and use it in GitHub Desktop.
Save Zenithar/8850e946836b2d3bd3aae794a534ce1e to your computer and use it in GitHub Desktop.
LUA Nginx Module Boring SSL Patch
diff --git a/src/ngx_http_lua_socket_tcp.c b/src/ngx_http_lua_socket_tcp.c
index 6db6e2d..cdad556 100644
--- a/src/ngx_http_lua_socket_tcp.c
+++ b/src/ngx_http_lua_socket_tcp.c
@@ -1327,7 +1327,7 @@ ngx_http_lua_socket_tcp_sslhandshake(lua_State *L)
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
- if (SSL_set_tlsext_host_name(c->ssl->connection, name.data)
+ if (SSL_set_tlsext_host_name(c->ssl->connection, (const char*)name.data)
== 0)
{
lua_pushnil(L);
diff --git a/src/ngx_http_lua_ssl_certby.c b/src/ngx_http_lua_ssl_certby.c
index aca4735..97623c4 100644
--- a/src/ngx_http_lua_ssl_certby.c
+++ b/src/ngx_http_lua_ssl_certby.c
@@ -1165,7 +1165,7 @@ ngx_http_lua_ffi_set_cert(ngx_http_request_t *r,
/* read rest of the chain */
- for (i = 1; i < sk_X509_num(chain); i++) {
+ for (i = 1; i < (int)sk_X509_num(chain); i++) {
x509 = sk_X509_value(chain, i);
if (x509 == NULL) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment