bungle / lua-resty-session

Session library for OpenResty – flexible and secure
BSD 2-Clause "Simplified" License
319 stars 111 forks source link

undefined symbol: FIPS_mode #176

Open CX-ZG opened 8 months ago

CX-ZG commented 8 months ago

My lua-resty-openidc encountered an error while running. I haven't solved it yet: 2024/01/23 10:40:58 [error] 17320#0: *2 lua entry thread aborted: runtime error: /usr/local/openresty/site/lualib/resty/openssl.lua:288: /www/server/nginx/luajit/lib/libluajit-5.1.so.2: undefined symbol: FIPS_mode stack traceback: coroutine 0: [C]: in function '__index' /usr/local/openresty/site/lualib/resty/openssl.lua:288: in function 'get_fips_mode' /usr/local/openresty/site/lualib/resty/session/utils.lua:42: in function 'is_fips_mode' /usr/local/openresty/site/lualib/resty/session/utils.lua:615: in function 'derive_aes_gcm_256_key_and_iv' /usr/local/openresty/site/lualib/resty/session.lua:940: in function 'save' /usr/local/openresty/site/lualib/resty/session.lua:1908: in function 'save' /usr/local/openresty/site/lualib/resty/openidc.lua:385: in function 'openidc_authorize' /usr/local/openresty/site/lualib/resty/openidc.lua:1543: in function 'authenticate'

bungle commented 8 months ago

@CX-ZG most likely difference in OpenSSL version (are you on 1.1.x?). Which version are you running?

bungle commented 8 months ago

Perhaps we need to pcall this and default to false in case it fails.

mioshare commented 4 months ago

In the openssl-1.1.1w version, I encountered the same error. When I used local status, res = pcall(require("resty.openssl").get_fips_mode()), I got the same error. Later, I commented out the line IS_FIPS = require "resty.session.utils".is_fips_mode() in utils.lua and changed it to IS_FIPS = false, which resolved the issue. However, I'm not sure if this modification affects the overall functionality.