-
Notifications
You must be signed in to change notification settings - Fork 120
Description
We're using an OSS plugin for Kong that is using the openidc.lua module to provide relying party functionality. We have configured it to use Azure Redis as the session store for the cluster, and it's been working just fine until a few days ago. What appears to be happening is that, randomly a request with the session cookie to the plugin results in a redirect to the IdP rather than using the cookie to find a valid access token in Redis (resulting in a CORS error). When this happens, this message is written to the Kong error log:
2023/05/08 10:54:17 [alert] 2741596#0: *368 ignoring stale global SSL error (SSL: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt), client: <client IP>, server: kong, request: "GET <requested URL> HTTP/1.1", host: "<hostname>", referrer: "<referring URL>"
I've been able to trace it down to when the authenticate() function is called in openidc.lua by the plugin code, and further this error is generated somewhere down in resty.session after this statement is called.
As stated, this is happening randomly, because the same plugin on the same endpoint on the same Kong node can successfully process a request from the same client right before the failed one. And when running this test multiple times, it will be different request URLs that trigger the error.
I had to manually edit openidc.lua to add debug log statements to get this far, and looking at the resty.session code, I have no idea how far down the rabbit hole this goes. I'm looking for recommendations on figuring out what is the cause of the error.