Check "is_ssl()" and change $uri

Our Server focus SSL but WordPress does not understand it. So the
default URLs are not right. This change fixes this issue.