rlaflamme commented on issue #10709:
URL: https://github.com/apache/apisix/issues/10709#issuecomment-1882350535

   I think I have found something.  I have been able to get it work ... with 
some little "cheat" int the file init.lua.
   
   First the issue is the evaluation of this line of code
   ```
       local matched_ssl = ctx.matched_ssl
       if matched_ssl.value.client and apisix_ssl.support_client_verification() 
then
           local verified = apisix_base_flags.client_cert_verified_in_handshake
           if not verified then
               -- vanilla OpenResty requires to check the verification result
               local res = ctx.var.ssl_client_verify
               if res ~= "SUCCESS" then
                   if res == "NONE" then
                       core.log.error("client certificate was not present")
                   else
                       core.log.error("client certificate verification is not 
passed: ", res)
                   end
   
                   return false
               end
           end
   ```
   It appears each time
   ```
   local verified = apisix_base_flags.client_cert_verified_in_handshake
   ```
   is evaluated to ***false*** no matter what
   In fact the value of the map variable  ***apisix_base_flags*** is empty.
   
   After digging for while by adding some traces in the code, I found this:
   ```
   2024/01/09 03:12:10 [info] 1#1: [lua] core.lua:26: use config_provider: etcd
   2024/01/09 03:12:10 [info] 1#1: [lua] init.lua:27: use discovery: kubernetes
   2024/01/09 03:12:10 [info] 1#1: [lua] init.lua:72: ####### apisix_base_flags 
= module 'resty.apisix.patch' not found:
        no field package.preload['resty.apisix.patch']
        no file '/usr/local/apisix//deps/share/lua/5.1/resty/apisix/patch.lua'
        no file 
'/usr/local/apisix//deps/share/lua/5.1/resty/apisix/patch/init.lua'
        no file '/usr/local/apisix/resty/apisix/patch.lua'
        no file '/usr/local/apisix/resty/apisix/patch/init.lua'
        no file 
'/opt/bitnami/apisix/openresty/site/lualib/resty/apisix/patch.ljbc'
        no file 
'/opt/bitnami/apisix/openresty/site/lualib/resty/apisix/patch/init.ljbc'
        no file '/opt/bitnami/apisix/openresty/lualib/resty/apisix/patch.ljbc'
        no file 
'/opt/bitnami/apisix/openresty/lualib/resty/apisix/patch/init.ljbc'
        no file 
'/opt/bitnami/apisix/openresty/site/lualib/resty/apisix/patch.lua'
        no file 
'/opt/bitnami/apisix/openresty/site/lualib/resty/apisix/patch/init.lua'
        no file '/opt/bitnami/apisix/openresty/lualib/resty/apisix/patch.lua'
        no file 
'/opt/bitnami/apisix/openresty/lualib/resty/apisix/patch/init.lua'
        no file './resty/apisix/patch.lua'
        no file 
'/opt/bitnami/apisix/openresty/luajit/share/luajit-2.1.0-beta3/resty/apisix/patch.lua'
        no file '/usr/local/share/lua/5.1/resty/apisix/patch.lua'
        no file '/usr/local/share/lua/5.1/resty/apisix/patch/init.lua'
        no file 
'/opt/bitnami/apisix/openresty/luajit/share/lua/5.1/resty/apisix/patch.lua'
        no file 
'/opt/bitnami/apisix/openresty/luajit/share/lua/5.1/resty/apisix/patch/init.lua'
        no file './resty/apisix/patch.lua'
        no file 
'/opt/bitnami/apisix/openresty/luajit/share/luajit-2.1.0-beta3/resty/apisix/patch.lua'
        no file '/usr/local/share/lua/5.1/resty/apisix/patch.lua'
        no file '/usr/local/share/lua/5.1/resty/apisix/patch/init.lua'
        no file 
'/opt/bitnami/apisix/openresty/luajit/share/lua/5.1/resty/apisix/patch.lua'
        no file 
'/opt/bitnami/apisix/openresty/luajit/share/lua/5.1/resty/apisix/patch/init.lua'
        no file 
'/opt/bitnami/apisix/openresty/site/lualib/resty/apisix/patch.ljbc'
        no file 
'/opt/bitnami/apisix/openresty/site/lualib/resty/apisix/patch/init.ljbc'
        no file '/opt/bitnami/apisix/openresty/lualib/resty/apisix/patch.ljbc'
        no file 
'/opt/bitnami/apisix/openresty/lualib/resty/apisix/patch/init.ljbc'
        no file 
'/opt/bitnami/apisix/openresty/site/lualib/resty/apisix/patch.lua'
        no file 
'/opt/bitnami/apisix/openresty/site/lualib/resty/apisix/patch/init.lua'
        no file '/opt/bitnami/apisix/openresty/lualib/resty/apisix/patch.lua'
        no file 
'/opt/bitnami/apisix/openresty/lualib/resty/apisix/patch/init.lua'
        no file './resty/apisix/patch.lua'
        no file 
'/opt/bitnami/apisix/openresty/luajit/share/luajit-2.1.0-beta3/resty/apisix/patch.lua'
        no file '/usr/local/share/lua/5.1/resty/apisix/patch.lua'
        no file '/usr/local/share/lua/5.1/resty/apisix/patch/init.lua'
        no file 
'/opt/bitnami/apisix/openresty/luajit/share/lua/5.1/resty/apisix/patch.lua'
        no file 
'/opt/bitnami/apisix/openresty/luajit/share/lua/5.1/resty/apisix/patch/init.lua'
        no file '/usr/local/apisix//deps/lib64/lua/5.1/resty/apisix/patch.so'
        no file '/usr/local/apisix//deps/lib/lua/5.1/resty/apisix/patch.so'
        no file 
'/opt/bitnami/apisix/openresty/site/lualib/resty/apisix/patch.so'
        no file '/opt/bitnami/apisix/openresty/lualib/resty/apisix/patch.so'
        no file './resty/apisix/patch.so'
        no file '/usr/local/lib/lua/5.1/resty/apisix/patch.so'
        no file 
'/opt/bitnami/apisix/openresty/luajit/lib/lua/5.1/resty/apisix/patch.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './resty/apisix/patch.so'
        no file '/usr/local/lib/lua/5.1/resty/apisix/patch.so'
        no file 
'/opt/bitnami/apisix/openresty/luajit/lib/lua/5.1/resty/apisix/patch.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file '/usr/local/apisix//deps/lib64/lua/5.1/resty.so'
        no file '/usr/local/apisix//deps/lib/lua/5.1/resty.so'
        no file '/opt/bitnami/apisix/openresty/site/lualib/resty.so'
        no file '/opt/bitnami/apisix/openresty/lualib/resty.so'
        no file './resty.so'
        no file '/usr/local/lib/lua/5.1/resty.so'
        no file '/opt/bitnami/apisix/openresty/luajit/lib/lua/5.1/resty.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './resty.so'
        n
   ```
   So it appears to be the issue.
   Now the "cheat" is  
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to