Or you can use a bit of round with a square milled on the end. Raise a coupe of burrs to hold it correctly in its hole and silver solder. Best if the socket isn’t a through hole, though that may not matter..
If the lug is on the end thin I’d mill a slot across the end and silver solder the appropriate bit of square in.
Or you can machine a length of bar with a ring on it and do it in several passes under hte mill with a dividing head – thats less elegant, because you then have to skin the final little facets off with a dividing head too.
If its a long slot(s) you can just mill the slots and loctite the bit of “spline” in , which is fine since the thrust is taken on the sides of the slot. If the machining is good and tight to width, the Loctite merely locates.