Bug #2802
closedwt-3.3.2-rc2 with ssl
Description
Hey,
I built my libs as usual and I get this error starting the server using HTTPS/Secure WebSocket, as long as the HTTP/WebSocket is ok:
[2014-Mar-11 14:02:19.618349] 1359 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2014-Mar-11 14:02:19.621704] 1359 - [info] "wthttp: starting server: https://0.0.0.0:443"
[2014-Mar-11 14:02:27.916313] 1359 - [error] "wthttp/async: remote_endpoint() threw: Transport endpoint is not connected"
[2014-Mar-11 14:02:27.933752] 1359 - [error] "wthttp/async: remote_endpoint() threw: Transport endpoint is not connected"
[2014-Mar-11 14:02:30.446412] 1359 - [error] "wthttp/async: remote_endpoint() threw: Transport endpoint is not connected"
10.0.2.80 - - [2014-Mar-11 14:02:32.567666] "G / HTTP/1.1" 501 97
BR,
Stoycho
Updated by Wim Dumon almost 11 years ago
- Status changed from New to Feedback
Does connecting over http work, despite the error?
Does connecting over https work, despite the error?
What version of Wt and operating system?
BR,
Wim.
Updated by Стойчо Стефанов Stoycho Stefanov almost 11 years ago
Hi Wim,
it connects over both web sockets (http and https). The plain http socket works fine. When you try to connect over https the server sends the certificate and than this page:
<html><head><title>Not Implemented</title></head><body><h1>501 Not Implemented</h1></body></html>
As you can see below, the server is starting and stopping properly.
wt-3.3.2-rc2
built with minGW and gcc-4.2. Here is the output from a linux machine:
~:/wtbugs# ./WebServer_wt_bugs --config ./wt_config.xml --docroot . --https-port 32 --https-address 0.0.0.0 --ssl-certificate ./ssl/SSLCert.pem --ssl-private-key ./ssl/SSLKey.pem --ssl-tmp-dh ./ssl/dh512.pem
Wt-3.3.2
[2014-Mar-11 17:16:29.531200] 1089 - [info] "config: reading Wt config file: ./wt_config.xml (location = '')"
[2014-Mar-11 17:16:29.543454] 1089 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2014-Mar-11 17:16:29.546504] 1089 - [info] "wthttp: starting server: https://0.0.0.0:32"
[2014-Mar-11 17:16:46.077160] 1089 - [error] "wthttp/async: remote_endpoint() threw: Transport endpoint is not connected"
[2014-Mar-11 17:16:46.094787] 1089 - [error] "wthttp/async: remote_endpoint() threw: Transport endpoint is not connected"
10.0.2.80 - - [2014-Mar-11 17:16:55.291147] "G / HTTP/1.1" 501 97
10.0.2.80 - - [2014-Mar-11 17:16:57.440801] "GT / HTTP/1.1" 501 97
10.0.2.80 - - [2014-Mar-11 17:16:57.739190] "GT / HTTP/1.1" 501 97
[2014-Mar-11 17:17:18.372807] 1089 - [info] "WebController: shutdown: stopping sessions."
[2014-Mar-11 17:17:18.373104] 1089 - [info] "WServer/wthttp: Shutdown: stopping web server."
~:/wtbugs#
~:/wtbugs#
~:/wtbugs#
~:/wtbugs# ./WebServer_wt_bugs --config ./wt_config.xml --docroot . --http-address 0.0.0.0 --http-port 32
Wt-3.3.2
[2014-Mar-11 17:17:49.859845] 1100 - [info] "config: reading Wt config file: ./imcresources/wt_config.xml (location = '')"
[2014-Mar-11 17:17:49.868782] 1100 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2014-Mar-11 17:17:49.872262] 1100 - [info] "wthttp: started server: http://0.0.0.0:32"
[2014-Mar-11 17:17:56.750816] 1100 - [info] "Wt: session created (#sessions = 1)"
[2014-Mar-11 17:17:56.752121] 1100 [/ b8iIA2b9NfJjmISS] [info] "WEnvironment: UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0"
10.0.2.80 - - [2014-Mar-11 17:17:56.763958] "GET / HTTP/1.1" 200 2197
regards,
stoycho
Updated by Koen Deforche almost 11 years ago
- Status changed from Feedback to InProgress
- Assignee set to Wim Dumon
It works fine on Ubuntu; a Windows-specific or MingW specific problem?
Updated by Стойчо Стефанов Stoycho Stefanov almost 11 years ago
Hey Wim,
I'm afraid I wasn't clear enough. It is not only a minGW problem! I have it on my embedded linux system as well (Linux 2.6.31.8) where wt is built with gcc-4.2-glibc-2.5-kernel-2.6.22 tool chain.
I could test it with tree other tool chains but I'm quite sure that it isn't a compiler specific problem. Moreover, I didn't make any changes in my build scripts, i.e., wt-3.3.2-rc2 is built the same way as wt-3.3.1 which works fine.
Please let me know if could give some other valuable details.
regards
Stoycho
Updated by Wim Dumon almost 11 years ago
Yes reproducible on windows. Fix attached and on its way to public repository.
diff --git a/src/http/RequestParser.C b/src/http/RequestParser.C
--- a/src/http/RequestParser.C
+++ b/src/http/RequestParser.C
@@ -109,13 +109,12 @@ boost::tuple<boost::tribool, Buffer::iterator>
RequestParser::parse(Request& req, Buffer::iterator begin,
Buffer::iterator end)
{
- boost::tribool Indeterminate = boost::indeterminate;
- boost::tribool& result(Indeterminate);
+ boost::tribool result = boost::indeterminate;
while (boost::indeterminate(result) && (begin != end))
result = consume(req, begin++);
- if (result == Indeterminate && currentString_) {
+ if (boost::indeterminate(result) && currentString_) {
req.headers.push_back(Request::Header());
currentString_->next = &req.headers.back().value;
currentString_ = currentString_->next;
Updated by Koen Deforche almost 11 years ago
- Status changed from InProgress to Resolved
Updated by Koen Deforche almost 11 years ago
- Status changed from Resolved to Closed