Index: src/http_ssl.c
==================================================================
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -280,10 +280,21 @@
     if( blob_str(&ans)[0]=='a' ) {
       ssl_save_certificate(cert);
     }
     blob_reset(&ans);
   }
+
+  /* Set the Global.zIpAddr variable to the server we are talking to.
+  ** This is used to populate the ipaddr column of the rcvfrom table,
+  ** if any files are received from the server.
+  */
+  {
+      /* IPv4 only code */
+      const unsigned char *ip = (const unsigned char *) BIO_get_conn_ip(iBio);
+      g.zIpAddr = mprintf("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
+  }
+
   X509_free(cert);
   return 0;
 }
 
 /*