Hi,

I have found out that when WSS is used and SSL handshake fails, httpd closes client connection without any response to the client.

In the log, one can see following:

mod_proxy_wstunnel.c(131): (103)Software caused connection abort: [client 127.0.0.1:49915] AH02442: error on sock - ap_get_brigade

Attached patch against 2.4.x fixes it. I'm not committing it, because this problem has been introduced in r1493741 and seems like intentional thing. This commit has been reverted in r1605946, so my theory is that this particular part of mod_proxy_wstunnel has not been reverted completely, but I want to be sure before I commit/propose.

Regards,
Jan Kaluza
Index: modules/proxy/mod_proxy_wstunnel.c
===================================================================
--- modules/proxy/mod_proxy_wstunnel.c	(revision 1665797)
+++ modules/proxy/mod_proxy_wstunnel.c	(working copy)
@@ -160,6 +160,7 @@
     conn_rec *c = r->connection;
     apr_socket_t *sock = conn->sock;
     conn_rec *backconn = conn->connection;
+    int client_error = 0;
     char *buf;
     apr_bucket_brigade *header_brigade;
     apr_bucket *e;
@@ -257,6 +258,9 @@
                     ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r, APLOGNO(02605)
                             "unknown event on backconn %d", pollevent);
                 }
+                if (rv != APR_SUCCESS) {
+                    client_error = 1;
+                }
             }
             else if (cur->desc.s == client_socket) {
                 pollevent = cur->rtnevents;
@@ -292,6 +296,10 @@
     ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
                   "finished with poll() - cleaning up");
 
+    if (client_error) {
+        return HTTP_INTERNAL_SERVER_ERROR;
+    }
+
     return OK;
 }
 

Reply via email to