diff --git a/lib/ruby_gems_gems_gem_simple.rb b/lib/ruby_gems_gems_gem_simple.rb
index <HASH>..<HASH> 100644
--- a/lib/ruby_gems_gems_gem_simple.rb
+++ b/lib/ruby_gems_gems_gem_simple.rb
@@ -13,10 +13,17 @@ class RubyGemsGems_GemSimple < GemSimple
     if from_git?
       return nil
     end
-    gem_uri = "#{@gems_url}/#{@name}-#{@version}.gem" 
-    Utils::log_debug "download and md5 for #{@name} from #{gem_uri}"
+    gem_uri = URI.parse("#{@gems_url}/#{@name}-#{@version}.gem")
+    uri_debug = gem_uri.clone
+    uri_debug.password = "********" if uri_debug.password
+    Utils::log_debug "download and md5 for #{@name} from #{uri_debug}"
     begin
-      source = open(gem_uri)
+      if gem_uri.user && gem_uri.password
+        source = open(gem_uri.scheme + "://" + gem_uri.host + "/" + gem_uri.path, 
+                      :http_basic_authentication=>[gem_uri.user, gem_uri.password])
+      else
+        source = open(gem_uri)
+      end
       @md5 = Digest::MD5.hexdigest(source.read)
       return @md5
     rescue
add support for username and password in the url