Subject: mod_ssl blocking on NS 6.1 HTTPS post

From: "Will Guaraldi" <[email-masked]>
Date: Wed, 13 Feb 2002 13:00:25 -0500

We seem to be having a problem with Netscpae 6.1 and 6.2 when interacting
with mod_ssl.  We're running Apache 1.3.20 (Win32) ApacheJServ/1.1.2
mod_ssl/2.8.4 on a Windows 2000 Server.  We're compiling it using VC++ 6.0.

The problem manifests itself like this.  We're doing an HTTPS post to a Java
Servlet.  In IE versions we've tested, everything goes along just fine.
When using Netscape 6.1 or 6.2 (6.0 is fine), the HTTPS post hangs.

I've been running Apache through the debugger and this is what I'm
observing:

I set Netscape 6.1 or 6.2 to do the HTTPS post request.  mod_ssl cycles
through SSL_recvwithtimeout in ssl_engine_io.c a few times.

The first time it picks up half the HTTP headers, the second time it picks
up the other half of the HTTP headers and a smidgeon of POST data.

On the third cycle through that code, it reaches the following snippet at
the very top of the SSL_recvwithtimeout function:

    if (!(tv.tv_sec = ap_check_alarm()))
       return (SSL_read(ssl, buf, len));

ap_check_alarm() is returning a 0 into tv.tv_sec.  This causes the code to
do the SSL_read, but it blocks on the read and never comes back unless I
kill the browser process.

When I use IE and go through the same procedure, the ap_check_alarm() call
returns a variety of numbers all in the upper 200's--it never returns a 0.

I've read through the mod_ssl archives and the Mozilla bugs and noticed that
there was a point in the Mozilla builds where it was having problems with
HTTP posts.  I can't tell if that's related to this or not.  I do know that
if I use Mozilla .9.8 everything works fine.

I have a few questions.  Why does mod_ssl execute ap_check_alarm?--I read
through the code, but I'm not seeing the 50' view of what's going on.  And
why would it return a 0, but only with Netscape 6.1 and 6.2?

Any help is greatly appreciated--

/will
[email-masked]

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

---

From: "Will Guaraldi" <[email-masked]>
Date: Tue, 19 Feb 2002 11:22:14 -0500

I do know that the ap_check_alarm is a function of the Apache server, but I
want to understand why mod_ssl is calling it in ssl_engine_io.c in the
SSL_recvwithtimeout function.

The specific code in question is this:

static int SSL_recvwithtimeout(BUFF *fb, char *buf, int len)
{
    int iostate = 1;
    fd_set fdset;
    struct timeval tv;
    int err = WSAEWOULDBLOCK;
    int rv;
    int sock = fb->fd_in;
    SSL *ssl;
    int retry;

    ssl = ap_ctx_get(fb->ctx, "ssl");

    // here for some reason ap_check_alarm() returns a 0 and it goes
    // into a blocking SSL_read and never returns
    if (!(tv.tv_sec = ap_check_alarm()))
        return (SSL_read(ssl, buf, len));

    rv = ioctlsocket(sock, FIONBIO, &iostate);
    iostate = 0;
    ap_assert(!rv);
    rv = SSL_read(ssl, buf, len);
    if (rv <= 0) {
        if (BIO_sock_should_retry(rv)) {
            do {
                retry = 0;
...

Anyone have any ideas?  Am I posting this on the wrong list?

/will

> -----Original Message-----
> From: [email-masked]
> [mailto:[email-masked]]On Behalf Of Will Guaraldi
> Sent: Wednesday, February 13, 2002 1:00 PM
> To: mod_ssl
> Subject: mod_ssl blocking on NS 6.1 HTTPS post
>
>