Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT token verification problem (undefined symbol: EVP_MD_CTX_create) #103

Open
jaceksocha opened this issue Jun 19, 2023 · 1 comment
Open

Comments

@jaceksocha
Copy link

jaceksocha commented Jun 19, 2023

Hi,

I'm facing some problems during jwt verification, which manifests itself as:

< HTTP/1.1 500 Internal Server Error < Server: openresty/1.21.4.1

(in openresty logs):

2023/06/19 20:44:32 [error] 1410#1410: *2 lua entry thread aborted: runtime error: /usr/local/openresty/site/lualib/resty/evp.lua:216: /usr/local/openresty/luajit/lib/libluajit-5.1.so.2: undefined symbol: EVP_MD_CTX_create stack traceback: coroutine 0: [C]: in function '__index' /usr/local/openresty/site/lualib/resty/evp.lua:216: in function 'verify' /usr/local/openresty/site/lualib/resty/jwt.lua:812: in function 'verify' access_by_lua(nginx.conf:89):30: in main chunk, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"

My stack:

Openresty version :
apt-cache policy openresty openresty: Installed: 1.21.4.1-1~focal1

lua-resty-jwt:
opm info lua-resty-jwt Name : lua-resty-jwt Version : 0.1.11

lua-resty-hmac:
opm info lua-resty-hmac Name : lua-resty-hmac Version : 0.06

OS:
lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.5 LTS Release: 20.04 Codename: focal

openssl
openssl OpenSSL> version OpenSSL 1.1.1f 31 Mar 2020

lua code :

`
location / {

          access_by_lua_block {

              local jwt = require("resty.jwt")
              local auth_header = ngx.var.http_Authorization
              local token
              local key = [[ -----BEGIN PUBLIC KEY-----
              <PUBLIC>
              -----END PUBLIC KEY-----
              ]]

              if auth_header then
                  token = string.match(auth_header, "Bearer%s+(.+)")
              end

              local verified = jwt:verify(key, token)

              if not verified then
                   ngx.exit(ngx.HTTP_UNAUTHORIZED)`

==================

It looks similar as old issue with openssl1.1:
zmartzone/lua-resty-openidc#161
zmartzone/lua-resty-openidc#162

I there anybody who had similar problem ?
Or maybe I'm doing something wrong ...

@zAbleXY
Copy link

zAbleXY commented Apr 23, 2024

Have you slove this problem yet? I still have this problem.

Details

2024/04/23 16:45:23 [error] 829033#829033: *31177 lua entry thread aborted: runtime error: /usr/local/openresty/site/lualib/resty/evp.lua:216: /usr/local/openresty/luajit/lib/libluajit-5.1.so.2: undefined symbol: EVP_MD_CTX_create
stack traceback:
coroutine 0:
[C]: in function '__index'
/usr/local/openresty/site/lualib/resty/evp.lua:216: in function 'verify'
/usr/local/openresty/site/lualib/resty/jwt.lua:812: in function 'verify'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants