This is the Euclidean Steiner tree problem and there is a large research literature on it: see, for example, the Wikipedia article.

In general the shortest network is created by adding new vertices (Steiner points) and at these new points the network will have three edges meeting at 120 degree angles.

For a square it looks like

Code:X---------X |\ /| | \ / | | o--o | | / \ | |/ \| X---------X