Index: src/wp-admin/network/upgrade.php
===================================================================
--- src/wp-admin/network/upgrade.php	(revision 37322)
+++ src/wp-admin/network/upgrade.php	(working copy)
@@ -63,8 +63,8 @@
 		echo "<ul>";
 		foreach ( (array) $blogs as $details ) {
 			switch_to_blog( $details['blog_id'] );
-			$siteurl = site_url();
-			$upgrade_url = admin_url( 'upgrade.php?step=upgrade_db' );
+			$siteurl = site_url( '', 'original' );
+			$upgrade_url = admin_url( 'upgrade.php?step=upgrade_db', 'original' );
 			restore_current_blog();
 
 			echo "<li>$siteurl</li>";
Index: src/wp-includes/link-template.php
===================================================================
--- src/wp-includes/link-template.php	(revision 37322)
+++ src/wp-includes/link-template.php	(working copy)
@@ -3413,10 +3413,11 @@
  *
  * @since 3.4.0
  * @since 4.4.0 The 'rest' scheme was added.
+ * @since 4.6.0 The 'original' scheme was added.
  *
  * @param string      $url    Absolute URL that includes a scheme
  * @param string|null $scheme Optional. Scheme to give $url. Currently 'http', 'https', 'login',
- *                            'login_post', 'admin', 'relative', 'rest', 'rpc', or null. Default null.
+ *                            'login_post', 'admin', 'relative', 'rest', 'rpc', 'original', or null. Default null.
  * @return string $url URL with chosen scheme.
  */
 function set_url_scheme( $url, $scheme = null ) {
@@ -3426,6 +3427,8 @@
 		$scheme = is_ssl() ? 'https' : 'http';
 	} elseif ( $scheme === 'admin' || $scheme === 'login' || $scheme === 'login_post' || $scheme === 'rpc' ) {
 		$scheme = is_ssl() || force_ssl_admin() ? 'https' : 'http';
+	} elseif ( $scheme === 'original' ) {
+		$scheme = 'https://' === substr( $url, 0, 8 ) ? 'https' : 'http';
 	} elseif ( $scheme !== 'http' && $scheme !== 'https' && $scheme !== 'relative' ) {
 		$scheme = is_ssl() ? 'https' : 'http';
 	}
@@ -3450,7 +3453,7 @@
 	 * @param string      $url         The complete URL including scheme and path.
 	 * @param string      $scheme      Scheme applied to the URL. One of 'http', 'https', or 'relative'.
 	 * @param string|null $orig_scheme Scheme requested for the URL. One of 'http', 'https', 'login',
-	 *                                 'login_post', 'admin', 'relative', 'rest', 'rpc', or null.
+	 *                                 'login_post', 'admin', 'relative', 'rest', 'rpc', 'original', or null.
 	 */
 	return apply_filters( 'set_url_scheme', $url, $scheme, $orig_scheme );
 }
