]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: ssl/lua: CacheCert needs OpenSSL
authorWilliam Lallemand <wlallemand@haproxy.org>
Wed, 30 Mar 2022 13:05:42 +0000 (15:05 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 30 Mar 2022 13:05:42 +0000 (15:05 +0200)
Return an lua error when trying to use CacheCert.set() and OpenSSL was
not used to build HAProxy.

src/hlua.c

index b925c2496e5f1b5a0e5bcaa774dca0616043eded..ea75b16eb5c24fa00aa55232a2f322a2902eab0f 100644 (file)
@@ -11369,6 +11369,7 @@ static struct cfg_kw_list cfg_kws = {{ },{
 
 INITCALL1(STG_REGISTER, cfg_register_keywords, &cfg_kws);
 
+#ifdef USE_OPENSSL
 
 /*
  * This function replace a ckch_store by another one, and rebuild the ckch_inst and all its dependencies.
@@ -11551,6 +11552,18 @@ end:
        return 0;
 }
 
+#else
+
+__LJMP static int hlua_ckch_set(lua_State *L)
+{
+       WILL_LJMP(luaL_error(L, "'CertCache.set' needs an HAProxy built with OpenSSL"));
+
+       return 0;
+}
+#endif /* ! USE_OPENSSL */
+
+
+
 /* This function can fail with an abort() due to an Lua critical error.
  * We are in the initialisation process of HAProxy, this abort() is
  * tolerated.