[求助]使用 lua-resty-hmac 的 new 方法时,返回总是 nil 而且 err 也是 nil

131 views
Skip to first unread message

Xiangxuan Qu

unread,
Apr 8, 2018, 6:01:23 AM4/8/18
to openresty
大家好!

我在 kong 中编写自定义插件的时候,需要调用 hmac:new 方法,但是一直返回 nil, 而且 err 也是 nil

请问各位遇到过类似情况吗,能指点一下不

我的环境是 docker kong:0.12.3-centos

相关代码
 local hm, err = hmac:new(conf.session_secret)
 if hm == nil then
   ngx.log(ngx.ERR, 'hmac failed secret:', conf.session_secret, "err:", err)
   return
 end


希望大家能予以相助,不胜感激

OscarZh

unread,
May 14, 2018, 10:04:12 PM5/14/18
to openresty
可以使用ngx.hmac_sha1,简单明了

在 2018年4月8日星期日 UTC+8下午6:01:23,Xiangxuan Qu写道:
Reply all
Reply to author
Forward
0 new messages