Steve Hay wrote:

> Mads Toftum wrote:
>
> > On Thu, Aug 03, 2000 at 02:01:02PM +0100, Steve Hay wrote:
> > >
> > > Perhaps the Apache Service doesn't pick up the STDOUT from the program
> > > properly?
> >
> > That would be my second guess. It shouldn't be too hard to debug if
> > you've got a compiler nearby. In the file ssl_engine_pphrase.c
> > look for "   * Filter program" - you could just change that block
> > to log some of all the variables available - the ssl_log function
> > would be an easy way.
>
> The service failed as before and output the following to the log file:
>     Init: Opening pipe to command...
>     Init: OK - fileno is: 5
>     Init: Reading upto 8191 characters from pipe...
>     Init: Closed pipe
>     Init: Read 0 characters:
>
> This can only mean that the read(...) in ssl_util_readfilter() above is failing.

Sorry to follow-up my own e-mail, but I've managed to get this working (ish?).

Kirk Benson's patch to get SSLPassPhraseDialog working under NT involved creating a 
new post_parse_init2() function in
http_main.c and calling that instead of post_parse_init() from within apache_main().

His e-mail at the time mentioned that post_parse_init() is also called from within 
service_init(), but he didn't touch it because
he didn't know what was supposed to happen in that case.  Largely out of desperation I 
tried applying a similar change to
service_init() and I've found that it seems to work.  I can at least start 
Apache/mod_ssl as an NT service and connect to it via
HTTPS.

A complete "diff -u" of http_main.c as patched by the mod_ssl configure.bat program 
before and after applying all the
post_parse_init() changes follows.

Can anyone shed any light on how sensible or not my hack to service_init() is?

Thanks,

Steve Hay


--- http_main.c.orig    Thu Aug 10 09:03:48 2000
+++ http_main.c Thu Aug 10 09:52:46 2000
@@ -6288,6 +6288,8 @@
     si.dwFlags     = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
     si.wShowWindow = SW_HIDE;
     si.hStdInput   = hPipeRead;
+    si.hStdOutput  = GetStdHandle(STD_OUTPUT_HANDLE);
+    si.hStdError   = GetStdHandle(STD_ERROR_HANDLE);

     if (!CreateProcess(NULL, pCommand, NULL, NULL,
                        TRUE,      /* Inherit handles */
@@ -6468,7 +6470,9 @@
        ap_clear_pool(plog);
        ap_open_logs(server_conf, plog);
        ap_set_version();
+#ifndef WIN32
        ap_init_modules(pconf, server_conf);
+#endif
        version_locked++;
         service_set_status(SERVICE_START_PENDING);
         /* Create child processes */
@@ -6673,6 +6677,19 @@
     set_group_privs();
 }

+#ifdef WIN32
+void post_parse_init2(int child)
+{
+    ap_set_version();
+    if (child || one_process)
+        ap_init_modules(pconf, server_conf);
+    ap_suexec_enabled = init_suexec();
+    version_locked++;
+    ap_open_logs(server_conf, plog);
+    set_group_privs();
+}
+#endif
+
 int service_init()
 {
     common_init();
@@ -6685,7 +6702,11 @@
     ap_setup_prelinked_modules();
     server_conf = ap_read_config(pconf, ptrans, ap_server_confname);
     ap_log_pid(pconf, ap_pid_fname);
+#ifdef WIN32
+    post_parse_init2(0);
+#else
     post_parse_init();
+#endif
     return TRUE;
 }

@@ -6968,7 +6989,11 @@
     }
 #endif

+#ifdef WIN32
+    post_parse_init2(child);
+#else
     post_parse_init();
+#endif

 #ifdef OS2
     printf("%s running...\n", ap_get_server_version());


______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to