diff --git a/lib/modules/SSL.pmod/File.pike b/lib/modules/SSL.pmod/File.pike
index e99d67390ef9e67e1fdcd1c591819eb4debe2fbf..00778e2571e80fd8a2fed85f8cf747a0b4c05304 100644
--- a/lib/modules/SSL.pmod/File.pike
+++ b/lib/modules/SSL.pmod/File.pike
@@ -1581,6 +1581,13 @@ function(void|mixed:int) query_close_callback()
   return close_callback;
 }
 
+int query_fd()
+//! @returns
+//!   Returns the file descriptor number associated with this object.
+{
+  return stream->query_fd ? stream->query_fd() : -1;
+}
+
 void set_id (mixed id)
 //! Set the value to be sent as the first argument to the
 //! callbacks installed by @[set_callbacks].