--- private_upload.module.orig	2008-10-17 08:34:28.000000000 -0500
+++ private_upload.module	2008-10-17 09:37:23.000000000 -0500
@@ -666,7 +666,14 @@ function _private_upload_is_url_private(
   // parse and open a socket to the requested resource
   $url_info=parse_url($url); 
   $port=isset($url_info['port']) ? $url_info['port'] : 80;
-  $fp=fsockopen($url_info['host'], $port, $errno, $errstr, $socket_open_timeout);
+  if ($url_info['scheme'] == 'https') {
+    $sslhost = 'ssl://' . $url_info['host'];
+    $port=isset($url_info['port']) ? $url_info['port'] : 443;
+    $fp=fsockopen($sslhost, $port, $errno, $errstr, $socket_open_timeout);
+  }
+  else {
+    $fp=fsockopen($url_info['host'], $port, $errno, $errstr, $socket_open_timeout);
+  }
 
   if(!$fp) {
     drupal_set_message( t("Unable to test file access: "). $errstr, 'error' );
