You can double click anywhere on a connector to add a text label in that position. Once created, that label can be rotated like any shape, using the rotation handle.

Animation of adding and rotating edge labels in draw.io

Animation of adding and rotating edge labels in draw.io