Try removing the highlighted block of code: https://github.com/TimWolla/haproxy-auth-request/blob/e6a686e6f192200a6c7001c303b87d2d6e9d4788/auth-request.lua#L45-L51
It's a monkey-patch to haproxy's socket that you might not need. On Fri, Aug 31, 2018 at 8:05 PM Computerisms Corporation <[email protected]> wrote: > > Hi Gurus; > > I was in the IRC channel the other day looking for a way to get > authentication through apache's authnz-external working from haproxy; > specifically I have a few nodejs applications and I want to put an > authentication system using imap in front. I already have > authnz-external working so it would be convenient to continue using it. > dcorbett suggested I investigate lua, which led me to finding > https://github.com/TimWolla/haproxy-auth-request. seems like just the > thing I need. > > After I checked that I met all the criteria and installed it and got > every thing setup and worked out my mistakes, I was left with log > entries like: Lua function 'auth-request': runtime error: > haproxy.auth.lua:48: bad argument #1 to 'old_settimeout' (number > expected, got nil) from [C] field 'request', haproxy.auth.lua:95 C > function line 56. > > Fortunately, the author was most excellent and documented the history of > this script here: https://bl.duesterhus.eu/20180119/, specifically the > section regarding haproxy's sockets. Through that post and also > comments in the github script containing links to > https://www.mail-archive.com/[email protected]/msg28604.html and > https://www.mail-archive.com/[email protected]/msg28574.html, I am > lead to believe this should be an fixed in my apt-installed version of > haproxy 1.8.13-1. > > I have been investigating, commenting code, and hacking by trial and > error to find a solution, but so far I am not able to get past this > point. Clearly my skills and understanding are not yet where they need > to be, being relatively new to both haproxy and lua. > > It occurs that this could be a lua problem (as opposed to haproxy), but > according to what I have read and understood, it seems that this is > related to haproxy's implementation of lua more than lua itself. Hence > I am asking here first. > > Wondering if anyone can offer some insight, or point me at some required > reading that might shed some light on this but isn't aimed at a > developer level of understanding? I have read through > https://www.arpalert.org/haproxy-lua.html#h211 a time or two, but if > there is a shining light bulb in there it hasn't blinded me yet. > > > -- > Bob Miller > Cell: 867-334-7117 > Office: 867-633-3760 > www.computerisms.ca >

