If I load the site https://ufrgs.br in a browser it gets redirected a couple of times to http://www.ufrgs.br/ufrgs/inicial
(no TLS (https) which is a bit oddâŚ)
Anyway, can you e.g. curl http://www.ufrgs.br/ufrgs/inicial
or curl http://[2804:1f20:0:1::20]/ufrgs/inicial
or curl http://143.54.2.20/ufrgs/inicial
? Iâm guessing that you should be able to do the last one but the other two should fail (because they both end up using IPv6 addressing and that seems to be problematic - see below)
I just tried this while using Wireshark to analyze network traffic:
wget --verbose --header="host: www.ufrgs.br" --user-agent="Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0" http://[2804:1f20:0:1::20]/ufrgs/inicial
(user agent and host headers taken from inspecting the request in Firefox)
http://www.ufrgs.br/ufrgs/inicial
is the home page from the university site after a couple of redirects (ufrgs.br
â www.ufrgs.br
â âŚ). Even though I used https as the protocol in the initial request in Firefox, the university server is only accepting unencrypted HTTP/1.1 requests (the second redirect is changing the location to the /ufrgs virtual host and effectively downgrading the connection from TLS 1.2 or 1.3 to cleartext HTTP/1.1. That just seems wrong in 2023; it may be misconfigured. Someone at the university should check).
If I try using the IPv6 address I get an ICMP destination unreachable (port unreachable) packet in response to the connect request (SYN).
If I try using the IPv4 address (http://143.54.2.20/ufrgs/inicial
) then I can download the home page from your university server.
It seems that thereâs a configuration issue thatâs being uncovered when using Fedora: the university server is accepting IPv4 HTTP requests on port 80 but not IPv6 requests, probably because the server is not configured to serve pages from port 80 if reached via IPv6. I am guessing that other OSs are somehow defaulting to IPv4 traffic and thatâs getting through unhindered. The question is a) why, if this is the case, is Fedora behaving differently and b) why, if this is the case, is the university server acting differently depending on the network stack that itâs bound to.
The university is using nginx which Iâm not very familiar with. As far as I know itâs a reverse-proxy and this is probably significant, but I donât enough about it to be able to say for sure.
You really need someone at the university who is familiar with the configuration to help you figure out what is going on. Iâm betting that it is a peculiarity of Fedora interacting with how this nginx server is configured, and youâre the only person who is doing something different. Probably everyone else is using Windows or maybe Ubuntu?
Itâs turning into a bit of a detective mystery (for me at least) and Iâm eager to know what is going on!
Addendum: I just tried using the university home page URI in a wget request while sniffing the net:
wget --verbose --header="host: www.ufrgs.br" --user-agent="Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0" http://www.ufrgs.br/ufrgs/inicial
This is slightly different but significant because DNS is involved in the request. This is what I see on the net:
- DNS IPv6 name resolver request for www.ufrgs.br (AAAA query record)
- DNS IPv4 name resolver request for www.ufrgs.br (A query record)
On modern systems these two requests go out virtually simultaneously because we now live in a mixed IPv6 and IPv4 world. The ordering is down to how the resolver is coded; it may be significant.
- An IPv6 RR packet (AAAA response) is returned from DNS (my router in this case) with the universityâs IPv6 address
- An IPv4 RR packet (A response) is returned from DNS with the univerityâs IPv4 address (these two items are basically the info that comes out of the nslookup ufrgs.br we did earlier)
- A TCP connection (SYN) request is made to the ufrgs.br IPv6 address
- An ICMPv6 desintation unreachable (port unreachable) packet is returned (not a RST or FIN meaning that port 80 isnât bound to the IPv6 stack at the server end)
- A TCP connection request is made to the urfgs.br IPv4 address.
- A TCP SYN-ACK response is returned from the server: the connection has been made
- Standard three-way handshake ACK from my computer to the university server
- The HTTP/1.1 (cleartext!) GET /ufrgs/inicial request is made
- The data is returned in a series of packets on the HTTP/1.1 connection
- The connection close is initiated by the client (FIN) (because the application exits)
- The university server finishes closing the connection (FIN-ACK)
So basically: we resolve the name, get an IPv6 and IPv4 response, in that order, try to connect to the IPv6 address on port 80 but that port is not bound to the IPv6 interface at the server so the request is denied via an ICMPv6 destination unreachable packet and we then fall back to the IPv4 address on which port 80 is bound to the interface and the request succeeds.
The ordering of whether to choose the IPv4 or IPv6 responses from the DNS server is likely significant yet a matter of chance: it likely depends on the choice made by the engineer who wrote the resolver code whereas a different implementation could perform the operations in the opposite order. Iâm guessing that e.g. Windows checks the IPv4 address first but Fedora is checking the IPv6 address first. If this is the case then it doesnât answer why your observed behavior is different from mine, namely that my installation falls back to attempting to make an IPv4 connection whereas either yours isnât, or thereâs yet another issue as to why your IPv4 request isnât being routed to the server correctly.
And at the bottom of it all is why the IPv4 and IPv6 stacks on the (nginx) server installation at your university are different: even though the server is telling browsers to connect to the HTTP server using HTTP/1.1 on port 80 (in cleartext!), it isnât configured that way for the IPv6 stack.
Once again, good luck!