Index: wp-includes/feed-rss2.php
===================================================================
--- wp-includes/feed-rss2.php	(revision 6425)
+++ wp-includes/feed-rss2.php	(working copy)
@@ -15,7 +15,7 @@
 
 <channel>
 	<title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
-	<atom:link href="<?php bloginfo('rss2_url') ?>" rel="self" type="application/rss+xml" />
+	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 	<link><?php bloginfo_rss('url') ?></link>
 	<description><?php bloginfo_rss("description") ?></description>
 	<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
Index: wp-includes/feed-rss2-comments.php
===================================================================
--- wp-includes/feed-rss2-comments.php	(revision 6425)
+++ wp-includes/feed-rss2-comments.php	(working copy)
@@ -17,7 +17,7 @@
 		else
 			printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
 	?></title>
-	<atom:link href="<?php bloginfo('comments_rss2_url') ?>" rel="self" type="application/rss+xml" />
+	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 	<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
 	<description><?php bloginfo_rss("description") ?></description>
 	<pubDate><?php echo gmdate('r'); ?></pubDate>
Index: wp-includes/feed.php
===================================================================
--- wp-includes/feed.php	(revision 6425)
+++ wp-includes/feed.php	(working copy)
@@ -220,4 +220,11 @@
 	}
 }
 
+function self_link() {
+	echo 'http'
+		. ( $_SERVER['https'] == 'on' ? 's' : '' ) . '://'
+		. $_SERVER['HTTP_HOST']
+		. wp_specialchars(stripslashes($_SERVER['REQUEST_URI']), 1);
+}
+
 ?>
