Commit Graph

126 Commits

Author SHA1 Message Date
moparisthebest aa13b9b980 Drop priveleges only after listening on possibly priveleged port 2013-04-19 07:58:58 -04:00
moparisthebest 7dfa559bc4 Add --honor-cipher-order option to mitigate BEAST attacks 2013-04-18 14:25:48 -04:00
snnn 4c238c5b36 fix building on mac os x. "error: invalid suffix on literal; C++11 requires a space between literal and identifier" 2013-04-17 14:33:55 +08:00
Tatsuhiro Tsujikawa 34e119fde2 shrpx: Remove useless backend spdy version check
It is unnecessary because spdy version at this point is always valid.
2013-03-29 22:16:50 +09:00
Tatsuhiro Tsujikawa a9f475fb88 spdycat, shrpx: TLS SNI enhancements
shrpx:
* Added an option to set the TLS SNI extension between shrpx and the
  origin on the command line

spdycat:
* If the user set an explicit host header ( using --headers ) use that
  name for the TLS SNI extension.
* Added the handshake completion time to the verbose output
* The gettimeofday call in get_time was using the incorrect structure
  ( I believe )
* In update_html_parser it was submitting the request regardless of
  the return value of add_request.

Patch from Stephen Ludin
2013-03-29 22:06:33 +09:00
Tatsuhiro Tsujikawa bdade00e68 cygwin build fix 2013-03-28 01:25:42 +09:00
Tatsuhiro Tsujikawa 7d709fa3ff shrpx: Support non-TLS SPDY in frontend connection 2013-03-24 21:03:39 +09:00
Tatsuhiro Tsujikawa 7264966bb5 shrpx: Check get_request_state() == MSG_COMPLETE when body is empty 2013-03-08 01:50:46 +09:00
Tatsuhiro Tsujikawa 4461cb24ed shrpx: Fix assertion failure in SpdyDownstreamConnection::attach_stream_data 2013-03-07 21:32:10 +09:00
Tatsuhiro Tsujikawa add067ed7e Provide timegm replacement and android build fix 2013-03-07 21:17:55 +09:00
Tatsuhiro Tsujikawa eddd48b783 shrpx: Don't issue RST_STREAM on downstream tunnel connection EOF
The RST_STREAM will be issued in spdy_data_read_callback.
2013-03-01 20:43:35 +09:00
Tatsuhiro Tsujikawa 2d23ae3741 shrpx: Fix missing delete 2013-03-01 00:07:00 +09:00
Tatsuhiro Tsujikawa cf1cfca51f shrpx: Fix not send RST_STREAM when downstream gets valid EOF 2013-03-01 00:05:57 +09:00
Tatsuhiro Tsujikawa da36fc3953 shrpx: Fix WINDOW_UPDATE may block until SpdyUpstream::send()
spdy_data_read_callback in SpdyDownstreamConnection calls
SpdyUpstream::resume_read() which submits WINDOW_UPDATE, but after
that they are not call SpdyUpstream::send(). This means that if no
pending outgoing data in upstream, then WINDOW_UPDATE is blocked until
SpdyUpstream::send() from somewhere. This change adds
SpdyUpstream::send() to resume_read() so that WINDOW_UPDATE is not
blocked.
2013-02-27 22:55:44 +09:00
Tatsuhiro Tsujikawa 7b3f57cef8 shrpx: Fix blocking upstream RST_STREAM and propagate REFUSED_STREAM
This change fixes upstream RST_STREAM is blocked until
SpdyUpstream::send() is called. Now downstream REFUSED_STREAM is
propagated to upstream client so that client can reset request.  The
RST_STREAM error code when downstream went wrong is changed from
CANCEL to INTERNAL_ERROR.
2013-02-27 22:39:44 +09:00
Tatsuhiro Tsujikawa dbb0df5c5b Remove strerror(3) from code which may run in multi-thread 2013-02-25 22:43:44 +09:00
Tatsuhiro Tsujikawa c487d152b2 shrpx: Add non-TLS SPDY backend connection support
Use --backend-spdy-no-tls to disable TLS on backend SPDY connection.
The SPDY protocol used there must be configured by
--backend-spdy-proto option.
2013-02-22 22:54:54 +09:00
Tatsuhiro Tsujikawa fc26f08af2 shrpx: Fix Proxy-Authorization is alwasy sent even if userinfo is empty
Surprisingly, field_set & UF_USERINFO is nonzero even if userinfo
component is empty string.
2013-02-22 21:23:59 +09:00
Tatsuhiro Tsujikawa 78523c6701 shrpx: Fix backend SPDY connection does not go through proxy 2013-02-22 19:30:15 +09:00
Tatsuhiro Tsujikawa 64fcac48b7 shrpx: Fix bug in building certificate lookup tree 2013-02-16 17:51:38 +09:00
Tatsuhiro Tsujikawa c8167234fa shrpx: Fix bug in certificate lookup 2013-02-16 02:33:16 +09:00
Tatsuhiro Tsujikawa abe5fd1e39 spdycat: Fix -d option in usage 2013-02-14 21:25:46 +09:00
Tatsuhiro Tsujikawa 54d5dda6c4 spdycat: Add --multiply option 2013-02-14 21:24:57 +09:00
Tatsuhiro Tsujikawa 3d2ef18afb spdycat: Fix error handling of spdylay_gzip_inflate() 2013-02-14 21:12:16 +09:00
Tatsuhiro Tsujikawa 291cbc639b shrpx: Use patricia trie for cert lookup 2013-02-14 00:28:55 +09:00
Tatsuhiro Tsujikawa e322af8a6f src: Add missing base64.h 2013-02-11 21:49:04 +09:00
Tatsuhiro Tsujikawa e28f169228 shrpx: More backend EOF handling
Now we set Downstream::set_response_connection_close(true) for
tunneled connections. Also call
Upstream::on_downstream_body_complete() callback when setting
MSG_COMPLETE in SpdySession when RST_STREAM is caught.  Clean up EOF
handling in https_downstream_readcb.
2013-02-11 17:20:52 +09:00
Tatsuhiro Tsujikawa d830e099a6 shrpx: Send pending response data before RST_STREAM in tunnel connection 2013-02-11 02:05:11 +09:00
Tatsuhiro Tsujikawa 734d7bced8 shrpx: Handle downstream response_state == MSG_RESET case in SPDY upstream 2013-02-09 23:20:29 +09:00
Tatsuhiro Tsujikawa 8b6fbbf3a6 shrpx: Update --backend-http-proxy-uri usage 2013-02-09 19:08:02 +09:00
Tatsuhiro Tsujikawa 39df51188c shrpx: Log stream ID when submitting RST_STREAM to downstream 2013-02-09 17:56:44 +09:00
Tatsuhiro Tsujikawa ceba5539a1 shrpx: Fix client mode does not work 2013-02-09 17:45:57 +09:00
Tatsuhiro Tsujikawa 18dc6384d4 shrpx: Remove x-forwarded-proto header from SPDY downstream
SPDY frame has :scheme header field, so x-forwarded-proto is not
necessary.
2013-02-09 17:22:33 +09:00
Tatsuhiro Tsujikawa b43b31c362 shrpx: Remove x-forwarded-spdy header field 2013-02-09 17:21:46 +09:00
Tatsuhiro Tsujikawa 4876412f7d shrpx: Check return value of HttpsUpstream::resume_read()
Currently, resume_read() fails if on_read() returns -1 in case that
evbuffer_add failed, which means, most likely, memory allocation
failure. ClientHandler is marked "should be closed", but if
evbuffer_add is failed, write callback will not be invoked and its
marking is not evaluated. It will eventually be deleted when the
client is disconnected or backend failure though.
2013-02-09 17:03:03 +09:00
Tatsuhiro Tsujikawa 99b687ceca shrpx: Documented --spdy-bridge 2013-02-09 16:55:49 +09:00
Tatsuhiro Tsujikawa cb8b8050b5 shprx: Add --backend-http-proxy-uri option
Specify proxy URI in the form http://[USER:PASS]PROXY:PORT. USER and
PASS are optional and if they exist they must be properly
percent-encoded. This proxy is used when the backend connection is
SPDY. First, make a CONNECT request to the proxy and it connects to
the backend on behalf of shrpx. This forms tunnel. After that, shrpx
performs SSL/TLS handshake with the downstream through the tunnel. The
timeouts when connecting and making CONNECT request can be specified
by --backend-read-timeout and --backend-write-timeout options.
2013-02-09 16:55:39 +09:00
Tatsuhiro Tsujikawa 9ba19df813 shrpx: Add --spdy-bridge option
With --spdy-bridge option, it listens SPDY/HTTPS connections from
front end and forwards them to the backend in SPDY. The usage will be
written later. This change fixes the crash when more than 2
outstanding SpdyDownstreamConnection objects are added to SpdySession
and establishing connection to SPDY backend is failed.
2013-02-08 21:46:58 +09:00
Tatsuhiro Tsujikawa 8925c58d71 shrpx: Send RST_STREAM when downstream becomes stale 2013-02-08 00:22:22 +09:00
Tatsuhiro Tsujikawa 9b4245368a shrpx: Refactor spdy downstream header field handling 2013-02-07 21:53:20 +09:00
Tatsuhiro Tsujikawa c707125839 shrpx: Explicitly hold server SSL_CTX and client SSL_CTX 2013-02-07 21:13:36 +09:00
Tatsuhiro Tsujikawa b18af854af shrpx: Add --subcert option to add additional certificate/private key
This option specifies additional certificate and private key
file. Shrpx will choose certificates based on the hostname indicated
by client using TLS SNI extension. This option can be used multiple
times.
2013-02-06 23:41:28 +09:00
Tatsuhiro Tsujikawa e3401b0159 shrpx: Lowercase x-forwarded-proto 2013-02-01 23:36:08 +09:00
Tatsuhiro Tsujikawa ae0533334c shrpx: Relay Connection: upgrade header field for HTTP/1.1 connections 2013-02-01 23:30:12 +09:00
Tatsuhiro Tsujikawa d9611e65ac spdycat: Send "accept-encoding: gzip, deflate" header field 2013-02-01 00:17:28 +09:00
Tatsuhiro Tsujikawa 2e3cd7d04f spdycat: Output error messages to std::cerr 2013-01-30 21:50:36 +09:00
Tatsuhiro Tsujikawa 37cb94d154 src: Use clock_gettime instead of gettimeofday if available 2013-01-27 17:16:13 +09:00
Tatsuhiro Tsujikawa 09154c61f6 spdycat, spdyd: Color verbose output 2013-01-27 16:27:17 +09:00
Tatsuhiro Tsujikawa 964c0d1005 shrpx: Don't return chunked response for pre-HTTP/1.1 request 2013-01-27 16:20:14 +09:00
Tatsuhiro Tsujikawa 817f35f3e4 spdycat: Free fd and SSL object on error 2013-01-25 23:15:34 +09:00