Skip to content

Commit 94d8ea2

Browse files
committed
WEBKAOS 1.13.0
1 parent 8b696b1 commit 94d8ea2

File tree

5 files changed

+80
-81
lines changed

5 files changed

+80
-81
lines changed

SOURCES/webkaos-dynamic-tls-records.patch

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,15 @@
1-
What we do now:
2-
We use a static record size of 4K. This gives a good balance of latency and
3-
throughput.
4-
5-
Optimize latency:
6-
By initialy sending small (1 TCP segment) sized records, we are able to avoid
7-
HoL blocking of the first byte. This means TTFB is sometime lower by a whole
8-
RTT.
9-
10-
Optimizing throughput:
11-
By sending increasingly larger records later in the connection, when HoL is not
12-
a problem, we reduce the overhead of TLS record (29 bytes per record with
13-
GCM/CHACHA-POLY).
14-
15-
Logic:
16-
Start each connection with small records (1369 byte default, change with
17-
ssl_dyn_rec_size_lo). After a given number of records (40, change with
18-
ssl_dyn_rec_threshold) start sending larger records (4229, ssl_dyn_rec_size_hi).
19-
Eventually after the same number of records, start sending the largest records
20-
(ssl_buffer_size).
21-
In case the connection idles for a given amount of time (1s,
22-
ssl_dyn_rec_timeout), the process repeats itself (i.e. begin sending small
23-
records again).
24-
25-
--- a/src/event/ngx_event_openssl.c
26-
+++ b/src/event/ngx_event_openssl.c
27-
@@ -1131,6 +1131,7 @@
1+
diff -urN nginx-1.13.0-orig/src/event/ngx_event_openssl.c nginx-1.13.0/src/event/ngx_event_openssl.c
2+
--- nginx-1.13.0-orig/src/event/ngx_event_openssl.c 2017-04-25 17:13:00.633648942 -0400
3+
+++ nginx-1.13.0/src/event/ngx_event_openssl.c 2017-04-25 17:39:34.000000000 -0400
4+
@@ -1173,6 +1173,7 @@
285

296
sc->buffer = ((flags & NGX_SSL_BUFFER) != 0);
307
sc->buffer_size = ssl->buffer_size;
318
+ sc->dyn_rec = ssl->dyn_rec;
329

3310
sc->session_ctx = ssl->ctx;
3411

35-
@@ -1669,6 +1670,41 @@
12+
@@ -1711,6 +1712,41 @@
3613

3714
for ( ;; ) {
3815

@@ -74,7 +51,7 @@ records again).
7451
while (in && buf->last < buf->end && send < limit) {
7552
if (in->buf->last_buf || in->buf->flush) {
7653
flush = 1;
77-
@@ -1770,6 +1806,9 @@
54+
@@ -1812,6 +1848,9 @@
7855

7956
if (n > 0) {
8057

@@ -84,29 +61,32 @@ records again).
8461
if (c->ssl->saved_read_handler) {
8562

8663
c->read->handler = c->ssl->saved_read_handler;
87-
--- a/src/event/ngx_event_openssl.h
88-
+++ b/src/event/ngx_event_openssl.h
89-
@@ -54,10 +54,19 @@
64+
diff -urN nginx-1.13.0-orig/src/event/ngx_event_openssl.h nginx-1.13.0/src/event/ngx_event_openssl.h
65+
--- nginx-1.13.0-orig/src/event/ngx_event_openssl.h 2017-04-25 17:13:00.634648923 -0400
66+
+++ nginx-1.13.0/src/event/ngx_event_openssl.h 2017-04-25 17:42:03.000000000 -0400
67+
@@ -53,6 +53,13 @@
68+
#define ngx_ssl_session_t SSL_SESSION
9069
#define ngx_ssl_conn_t SSL
9170

92-
9371
+typedef struct {
9472
+ ngx_msec_t timeout;
9573
+ ngx_uint_t threshold;
9674
+ size_t size_lo;
9775
+ size_t size_hi;
9876
+} ngx_ssl_dyn_rec_t;
9977
+
100-
+
101-
struct ngx_ssl_s {
78+
79+
#if (OPENSSL_VERSION_NUMBER < 0x10002000L)
80+
#define SSL_is_server(s) (s)->server
81+
@@ -63,6 +70,7 @@
10282
SSL_CTX *ctx;
10383
ngx_log_t *log;
10484
size_t buffer_size;
10585
+ ngx_ssl_dyn_rec_t dyn_rec;
10686
};
10787

10888

109-
@@ -80,6 +89,10 @@
89+
@@ -85,6 +93,10 @@
11090
unsigned no_wait_shutdown:1;
11191
unsigned no_send_shutdown:1;
11292
unsigned handshake_buffer_set:1;
@@ -117,7 +97,7 @@ records again).
11797
};
11898

11999

120-
@@ -89,7 +102,7 @@
100+
@@ -94,7 +106,7 @@
121101
#define NGX_SSL_DFLT_BUILTIN_SCACHE -5
122102

123103

@@ -126,9 +106,10 @@ records again).
126106

127107
typedef struct ngx_ssl_sess_id_s ngx_ssl_sess_id_t;
128108

129-
--- a/src/http/modules/ngx_http_ssl_module.c
130-
+++ b/src/http/modules/ngx_http_ssl_module.c
131-
@@ -233,6 +233,41 @@
109+
diff -urN nginx-1.13.0-orig/src/http/modules/ngx_http_ssl_module.c nginx-1.13.0/src/http/modules/ngx_http_ssl_module.c
110+
--- nginx-1.13.0-orig/src/http/modules/ngx_http_ssl_module.c 2017-04-25 17:13:00.643648755 -0400
111+
+++ nginx-1.13.0/src/http/modules/ngx_http_ssl_module.c 2017-04-25 17:46:13.000000000 -0400
112+
@@ -234,6 +234,41 @@
132113
offsetof(ngx_http_ssl_srv_conf_t, stapling_verify),
133114
NULL },
134115

@@ -170,7 +151,7 @@ records again).
170151
ngx_null_command
171152
};
172153

173-
@@ -533,6 +568,11 @@
154+
@@ -555,6 +590,11 @@
174155
sscf->session_ticket_keys = NGX_CONF_UNSET_PTR;
175156
sscf->stapling = NGX_CONF_UNSET;
176157
sscf->stapling_verify = NGX_CONF_UNSET;
@@ -182,7 +163,7 @@ records again).
182163

183164
return sscf;
184165
}
185-
@@ -598,6 +638,20 @@
166+
@@ -620,6 +660,20 @@
186167
ngx_conf_merge_str_value(conf->stapling_responder,
187168
prev->stapling_responder, "");
188169

@@ -203,7 +184,7 @@ records again).
203184
conf->ssl.log = cf->log;
204185

205186
if (conf->enable) {
206-
@@ -778,6 +832,28 @@
187+
@@ -800,6 +854,28 @@
207188

208189
}
209190

@@ -232,8 +213,9 @@ records again).
232213
return NGX_CONF_OK;
233214
}
234215

235-
--- a/src/http/modules/ngx_http_ssl_module.h
236-
+++ b/src/http/modules/ngx_http_ssl_module.h
216+
diff -urN nginx-1.13.0-orig/src/http/modules/ngx_http_ssl_module.h nginx-1.13.0/src/http/modules/ngx_http_ssl_module.h
217+
--- nginx-1.13.0-orig/src/http/modules/ngx_http_ssl_module.h 2017-04-25 17:13:00.649648644 -0400
218+
+++ nginx-1.13.0/src/http/modules/ngx_http_ssl_module.h 2017-04-25 17:46:52.000000000 -0400
237219
@@ -57,6 +57,12 @@
238220

239221
u_char *file;

SOURCES/webkaos.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ http {
123123
ssl_session_timeout 5m;
124124
ssl_prefer_server_ciphers on;
125125
ssl_dyn_rec_enable on;
126-
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
126+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
127127
ssl_dhparam /etc/webkaos/ssl/dhparam.pem;
128128

129129
ssl_stapling on;

SOURCES/webkaos.patch

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
diff -urN nginx-1.11.13-orig/auto/lib/openssl/make nginx-1.11.13/auto/lib/openssl/make
2-
--- nginx-1.11.13-orig/auto/lib/openssl/make 2017-04-08 17:37:31.291426468 -0400
3-
+++ nginx-1.11.13/auto/lib/openssl/make 2017-04-08 17:39:20.783343726 -0400
1+
diff -urN nginx-1.13.0-orig/auto/lib/openssl/make nginx-1.13.0/auto/lib/openssl/make
2+
--- nginx-1.13.0-orig/auto/lib/openssl/make 2017-04-25 17:13:00.618649224 -0400
3+
+++ nginx-1.13.0/auto/lib/openssl/make 2017-04-25 17:13:19.755289174 -0400
44
@@ -45,18 +45,18 @@
55
/*) ngx_prefix="$OPENSSL/.openssl" ;;
66
*) ngx_prefix="$PWD/$OPENSSL/.openssl" ;;
@@ -24,9 +24,9 @@ diff -urN nginx-1.11.13-orig/auto/lib/openssl/make nginx-1.11.13/auto/lib/openss
2424
;;
2525

2626
esac
27-
diff -urN nginx-1.11.13-orig/src/core/nginx.c nginx-1.11.13/src/core/nginx.c
28-
--- nginx-1.11.13-orig/src/core/nginx.c 2017-04-08 17:37:31.319425061 -0400
29-
+++ nginx-1.11.13/src/core/nginx.c 2017-04-08 17:39:20.800343165 -0400
27+
diff -urN nginx-1.13.0-orig/src/core/nginx.c nginx-1.13.0/src/core/nginx.c
28+
--- nginx-1.13.0-orig/src/core/nginx.c 2017-04-25 17:13:00.666648328 -0400
29+
+++ nginx-1.13.0/src/core/nginx.c 2017-04-25 17:13:19.773290501 -0400
3030
@@ -382,13 +382,13 @@
3131
static void
3232
ngx_show_version_info(void)
@@ -45,13 +45,13 @@ diff -urN nginx-1.11.13-orig/src/core/nginx.c nginx-1.11.13/src/core/nginx.c
4545
"Options:" NGX_LINEFEED
4646
" -?,-h : this help" NGX_LINEFEED
4747
" -v : show version and exit" NGX_LINEFEED
48-
diff -urN nginx-1.11.13-orig/src/core/nginx.h nginx-1.11.13/src/core/nginx.h
49-
--- nginx-1.11.13-orig/src/core/nginx.h 2017-04-08 17:37:31.322424960 -0400
50-
+++ nginx-1.11.13/src/core/nginx.h 2017-04-08 17:40:12.000000000 -0400
48+
diff -urN nginx-1.13.0-orig/src/core/nginx.h nginx-1.13.0/src/core/nginx.h
49+
--- nginx-1.13.0-orig/src/core/nginx.h 2017-04-25 17:13:00.670648253 -0400
50+
+++ nginx-1.13.0/src/core/nginx.h 2017-04-25 17:14:15.000000000 -0400
5151
@@ -11,7 +11,7 @@
5252

53-
#define nginx_version 1011013
54-
#define NGINX_VERSION "1.11.13"
53+
#define nginx_version 1013000
54+
#define NGINX_VERSION "1.13.0"
5555
-#define NGINX_VER "nginx/" NGINX_VERSION
5656
+#define NGINX_VER "webkaos/" NGINX_VERSION
5757

@@ -66,9 +66,9 @@ diff -urN nginx-1.11.13-orig/src/core/nginx.h nginx-1.11.13/src/core/nginx.h
6666
#define NGX_OLDPID_EXT ".oldbin"
6767

6868

69-
diff -urN nginx-1.11.13-orig/src/core/ngx_log.c nginx-1.11.13/src/core/ngx_log.c
70-
--- nginx-1.11.13-orig/src/core/ngx_log.c 2017-04-08 17:37:31.322424960 -0400
71-
+++ nginx-1.11.13/src/core/ngx_log.c 2017-04-08 17:39:20.823342523 -0400
69+
diff -urN nginx-1.13.0-orig/src/core/ngx_log.c nginx-1.13.0/src/core/ngx_log.c
70+
--- nginx-1.13.0-orig/src/core/ngx_log.c 2017-04-25 17:13:00.669648272 -0400
71+
+++ nginx-1.13.0/src/core/ngx_log.c 2017-04-25 17:13:19.816292375 -0400
7272
@@ -202,9 +202,9 @@
7373
return;
7474
}
@@ -99,9 +99,9 @@ diff -urN nginx-1.11.13-orig/src/core/ngx_log.c nginx-1.11.13/src/core/ngx_log.c
9999
return NGX_CONF_ERROR;
100100
#endif
101101

102-
diff -urN nginx-1.11.13-orig/src/http/modules/ngx_http_autoindex_module.c nginx-1.11.13/src/http/modules/ngx_http_autoindex_module.c
103-
--- nginx-1.11.13-orig/src/http/modules/ngx_http_autoindex_module.c 2017-04-08 17:37:31.310425424 -0400
104-
+++ nginx-1.11.13/src/http/modules/ngx_http_autoindex_module.c 2017-04-08 17:39:20.838342106 -0400
102+
diff -urN nginx-1.13.0-orig/src/http/modules/ngx_http_autoindex_module.c nginx-1.13.0/src/http/modules/ngx_http_autoindex_module.c
103+
--- nginx-1.13.0-orig/src/http/modules/ngx_http_autoindex_module.c 2017-04-25 17:13:00.646648701 -0400
104+
+++ nginx-1.13.0/src/http/modules/ngx_http_autoindex_module.c 2017-04-25 17:13:19.836292484 -0400
105105
@@ -445,9 +445,11 @@
106106
;
107107

@@ -177,9 +177,9 @@ diff -urN nginx-1.11.13-orig/src/http/modules/ngx_http_autoindex_module.c nginx-
177177
tm.ngx_tm_mday,
178178
months[tm.ngx_tm_mon - 1],
179179
tm.ngx_tm_year,
180-
diff -urN nginx-1.11.13-orig/src/http/ngx_http_header_filter_module.c nginx-1.11.13/src/http/ngx_http_header_filter_module.c
181-
--- nginx-1.11.13-orig/src/http/ngx_http_header_filter_module.c 2017-04-08 17:37:31.314425259 -0400
182-
+++ nginx-1.11.13/src/http/ngx_http_header_filter_module.c 2017-04-08 17:48:03.000000000 -0400
180+
diff -urN nginx-1.13.0-orig/src/http/ngx_http_header_filter_module.c nginx-1.13.0/src/http/ngx_http_header_filter_module.c
181+
--- nginx-1.13.0-orig/src/http/ngx_http_header_filter_module.c 2017-04-25 17:13:00.655648533 -0400
182+
+++ nginx-1.13.0/src/http/ngx_http_header_filter_module.c 2017-04-25 17:18:05.000000000 -0400
183183
@@ -46,7 +46,7 @@
184184
};
185185

@@ -189,7 +189,7 @@ diff -urN nginx-1.11.13-orig/src/http/ngx_http_header_filter_module.c nginx-1.11
189189
static u_char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;
190190
static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF;
191191

192-
@@ -109,8 +109,30 @@
192+
@@ -110,8 +110,30 @@
193193
ngx_null_string, /* "427 unused" */
194194
ngx_null_string, /* "428 Precondition Required" */
195195
ngx_string("429 Too Many Requests"),
@@ -221,9 +221,9 @@ diff -urN nginx-1.11.13-orig/src/http/ngx_http_header_filter_module.c nginx-1.11
221221
#define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX)
222222

223223
ngx_string("500 Internal Server Error"),
224-
diff -urN nginx-1.11.13-orig/src/http/ngx_http_special_response.c nginx-1.11.13/src/http/ngx_http_special_response.c
225-
--- nginx-1.11.13-orig/src/http/ngx_http_special_response.c 2017-04-08 17:37:31.315425217 -0400
226-
+++ nginx-1.11.13/src/http/ngx_http_special_response.c 2017-04-08 17:49:28.000000000 -0400
224+
diff -urN nginx-1.13.0-orig/src/http/ngx_http_special_response.c nginx-1.13.0/src/http/ngx_http_special_response.c
225+
--- nginx-1.13.0-orig/src/http/ngx_http_special_response.c 2017-04-25 17:13:00.657648495 -0400
226+
+++ nginx-1.13.0/src/http/ngx_http_special_response.c 2017-04-25 17:22:31.000000000 -0400
227227
@@ -19,21 +19,21 @@
228228

229229

@@ -249,7 +249,7 @@ diff -urN nginx-1.11.13-orig/src/http/ngx_http_special_response.c nginx-1.11.13/
249249
"</body>" CRLF
250250
"</html>" CRLF
251251
;
252-
@@ -59,265 +59,302 @@
252+
@@ -59,273 +59,311 @@
253253

254254
static char ngx_http_error_301_page[] =
255255
"<html>" CRLF
@@ -299,6 +299,18 @@ diff -urN nginx-1.11.13-orig/src/http/ngx_http_special_response.c nginx-1.11.13/
299299
;
300300

301301

302+
static char ngx_http_error_308_page[] =
303+
"<html>" CRLF
304+
-"<head><title>308 Permanent Redirect</title></head>" CRLF
305+
-"<body bgcolor=\"white\">" CRLF
306+
-"<center><h1>308 Permanent Redirect</h1></center>" CRLF
307+
+"<head><title>308 Permanent Redirect</title>" CRLF
308+
+"<style>html,body{background-color:#EEE;color:#AAA;font:100 1em/1em 'Segoe UI Light','Open Sans Light','Open Sans','Segoe UI','Helvetica Neue',Helvetica,Trebuchet,sans-serif;height:100%;margin:0;text-align:center}body:after{content:'';display:inline-block;height:100%;vertical-align:middle}div{display:inline-block}h1,h3{color:#333;font-weight:100}</style></head>" CRLF
309+
+"<body>" CRLF
310+
+"<div><h1>308 Permanent Redirect</h1>" CRLF
311+
;
312+
313+
302314
static char ngx_http_error_400_page[] =
303315
"<html>" CRLF
304316
-"<head><title>400 Bad Request</title></head>" CRLF
@@ -656,7 +668,7 @@ diff -urN nginx-1.11.13-orig/src/http/ngx_http_special_response.c nginx-1.11.13/
656668
;
657669

658670

659-
@@ -370,8 +407,30 @@
671+
@@ -379,8 +417,30 @@
660672
ngx_null_string, /* 427 */
661673
ngx_null_string, /* 428 */
662674
ngx_string(ngx_http_error_429_page),
@@ -688,9 +700,9 @@ diff -urN nginx-1.11.13-orig/src/http/ngx_http_special_response.c nginx-1.11.13/
688700
#define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX)
689701

690702
ngx_string(ngx_http_error_494_page), /* 494, request header too large */
691-
diff -urN nginx-1.11.13-orig/src/http/v2/ngx_http_v2_filter_module.c nginx-1.11.13/src/http/v2/ngx_http_v2_filter_module.c
692-
--- nginx-1.11.13-orig/src/http/v2/ngx_http_v2_filter_module.c 2017-04-08 17:37:31.317425133 -0400
693-
+++ nginx-1.11.13/src/http/v2/ngx_http_v2_filter_module.c 2017-04-08 17:51:03.000000000 -0400
703+
diff -urN nginx-1.13.0-orig/src/http/v2/ngx_http_v2_filter_module.c nginx-1.13.0/src/http/v2/ngx_http_v2_filter_module.c
704+
--- nginx-1.13.0-orig/src/http/v2/ngx_http_v2_filter_module.c 2017-04-25 17:13:00.660648440 -0400
705+
+++ nginx-1.13.0/src/http/v2/ngx_http_v2_filter_module.c 2017-04-25 17:13:19.869291927 -0400
694706
@@ -139,7 +139,7 @@
695707
ngx_http_core_srv_conf_t *cscf;
696708
u_char addr[NGX_SOCKADDR_STRLEN];
@@ -709,9 +721,9 @@ diff -urN nginx-1.11.13-orig/src/http/v2/ngx_http_v2_filter_module.c nginx-1.11.
709721
}
710722

711723
*pos++ = ngx_http_v2_inc_indexed(NGX_HTTP_V2_SERVER_INDEX);
712-
diff -urN nginx-1.11.13-orig/src/os/unix/ngx_setproctitle.c nginx-1.11.13/src/os/unix/ngx_setproctitle.c
713-
--- nginx-1.11.13-orig/src/os/unix/ngx_setproctitle.c 2017-04-08 17:37:31.297426087 -0400
714-
+++ nginx-1.11.13/src/os/unix/ngx_setproctitle.c 2017-04-08 17:39:20.887340739 -0400
724+
diff -urN nginx-1.13.0-orig/src/os/unix/ngx_setproctitle.c nginx-1.13.0/src/os/unix/ngx_setproctitle.c
725+
--- nginx-1.13.0-orig/src/os/unix/ngx_setproctitle.c 2017-04-25 17:13:00.624649111 -0400
726+
+++ nginx-1.13.0/src/os/unix/ngx_setproctitle.c 2017-04-25 17:13:19.883291667 -0400
715727
@@ -89,7 +89,7 @@
716728

717729
ngx_os_argv[1] = NULL;

webkaos-centos.spec

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
%define service_name %{name}
4545
%define service_home %{_cachedir}/%{service_name}
4646

47-
%define boring_commit 6114c3c5d4086d4a0b56c7f6eaa2ebd70d2bea93
47+
%define boring_commit d617e01cfa59d11b6474380738c92ef2c0d4b09a
4848
%define psol_ver 1.11.33.4
4949
%define lua_module_ver 0.10.7
5050
%define mh_module_ver 0.32
@@ -59,8 +59,8 @@
5959

6060
Summary: Superb high performance web server
6161
Name: webkaos
62-
Version: 1.11.13
63-
Release: 1%{?dist}
62+
Version: 1.13.0
63+
Release: 0%{?dist}
6464
License: 2-clause BSD-like license
6565
Group: System Environment/Daemons
6666
Vendor: Nginx / Google / CloudFlare / ESSENTIALKAOS
@@ -581,6 +581,11 @@ rm -rf %{buildroot}
581581
###############################################################################
582582

583583
%changelog
584+
* Wed Apr 26 2017 Anton Novojilov <andy@essentialkaos.com> - 1.13.0-0
585+
- Nginx updated to 1.13.0
586+
- BoringSSL updated to latest version
587+
- TLS 1.3 enabled by default
588+
584589
* Wed Apr 19 2017 Anton Novojilov <andy@essentialkaos.com> - 1.11.13-1
585590
- Added AES128-SHA to list of supported ciphers
586591

0 commit comments

Comments
 (0)