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

IPV6 server name fails #169

Open
magnNorth opened this issue Jan 17, 2018 · 1 comment
Open

IPV6 server name fails #169

magnNorth opened this issue Jan 17, 2018 · 1 comment
Labels

Comments

@magnNorth
Copy link

Hey, trying to pass an ipv6 request through esi make thing fall over.
https://github.com/pintsized/ledge/blob/35bbcdadc55f65c1c3e43f0ebd054868e345eb94/lib/ledge/esi.lua#L366

the error
esi.lua:373: esi_fetch_include(): failed to parse host name "9999:da0:a8:f610::f:316": invalid port connecting to 9999:da0:a8:f610::f:316:443

suggests that the format of the request is incorrect.
Testing with simple curls:
curl -g -6 https://9999:da0:a8:f610::f:316:443 - fails while
curl -g -6 https://[9999:da0:a8:f610::f:316]:443 - work just fine.

I have bypassed the effect of this code block
`
local upstream = host

   if upstream == ngx_var.http_host then
        upstream = ngx_var.server_addr
        port = ngx_var.server_port
    end

`
by ignoring the reassignment of upstream = ngx_var.server_addr.
doing this makes the system work correctly but ultimately the detection and correct request for the IPV6 server_addr would be a better solution.

@hamishforbes
Copy link
Collaborator

Yeah looks like ngx.socket.tcp requires ipv6 addresses to be wrapped as well, but hte server_addr var doesn't wrap them.
https://github.com/openresty/lua-nginx-module/blob/90d7522342e78ecb1f1ea2b5d066ade404a48b24/t/058-tcp-socket.t#L3251

I guess we'll have to detect ipv6 server_addr values and wrap them ourselves!

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

No branches or pull requests

2 participants