--- inn-2.3.2/nnrpd/perl.c	Thu May  3 22:27:32 2001
+++ inn-2.3.2-perlauth/nnrpd/perl.c	Tue Feb 12 10:13:54 2002
@@ -39,6 +39,11 @@
 #include <XSUB.h>
 #include "ppport.h"
 
+#ifdef HAVE_SSL
+#include <openssl/ssl.h>
+extern SSL *tls_conn;
+#endif
+
 extern BOOL PerlFilterActive;
 extern HEADER	Table[], *EndOfTable;
 extern char LogName[];
@@ -212,6 +217,12 @@
     hv_store(attribs, "hostname", 8, newSVpv(ClientHost, 0), 0);
     hv_store(attribs, "interface", 9, newSVpv(ServerHost, 0), 0);
     hv_store(attribs, "ipaddress", 9, newSVpv(ClientIP, 0), 0);
+#ifdef HAVE_SSL
+    if (tls_conn)
+	    hv_store(attribs, "tls", 3, newSViv(1), 0);
+    else
+#endif
+	    hv_store(attribs, "tls", 3, newSViv(0), 0);
     
     PUSHMARK(SP);
     rc = perl_call_pv("authenticate", G_EVAL|G_ARRAY);
@@ -307,6 +318,13 @@
     hv_store(attribs, "interface", 9, newSVpv(ServerHost, 0), 0);
     hv_store(attribs, "username", 8, newSVpv(user, 0), 0);
     hv_store(attribs, "password", 8, newSVpv(passwd, 0), 0);
+#ifdef HAVE_SSL
+    if (tls_conn)
+	    hv_store(attribs, "tls", 3, newSViv(1), 0);
+    else
+#endif
+	    hv_store(attribs, "tls", 3, newSViv(0), 0);
+
     
     PUSHMARK(SP);
     rc = perl_call_pv("authenticate", G_EVAL|G_ARRAY);
