For me, only ssh links worked steadily. The https links were time out many times. So my workaround was to fork all packages and change the https:// to ssh:// dependencies one by one.
Since packages are inter-dependent. The work is easy but not satisfied. So is there a way that I could set in SwiftPM so it could replace all https:// with ssh:// during the preparing process, then I don't have to edit them one by one?