My dad had his mechanic at work build a rail out of 4in Square metal tubing. It is welded and it looks professional. It is not the rail
Sounds like there might not be an open end but rather a square 90 degree point (4" square for the top + 4" square for verticals).
I'm right, that's one of those "put an eye out" kind of builds.