1
- diff -r 2e63d59c342d src/event/ngx_event_openssl.c
2
- --- a/src/event/ngx_event_openssl.c Tue Sep 10 16:48:11 2024 +0400
3
- +++ b/src/event/ngx_event_openssl.c Sat Sep 14 18:00:11 2024 +0000
4
- @@ -1742 ,6 +1742 ,7 @@
1
+ diff -u src/event/ngx_event_openssl.c src/event/ngx_event_openssl.c
2
+ --- a/src/event/ngx_event_openssl.c 2025-05-09 09:22:41.641816383 +0000
3
+ +++ b/src/event/ngx_event_openssl.c 2025-05-09 09:50:23.401472760 +0000
4
+ @@ -1624 ,6 +1624 ,7 @@
5
5
#ifdef SSL_OP_NO_RENEGOTIATION
6
6
SSL_set_options(sc->connection, SSL_OP_NO_RENEGOTIATION);
7
7
#endif
8
8
+ SSL_set_options(sc->connection, SSL_OP_NO_TICKET);
9
9
}
10
10
11
11
if (SSL_set_ex_data(sc->connection, ngx_ssl_connection_index, c) == 0) {
12
- @@ -1793 ,6 +1794,116 @@
12
+ @@ -1675 ,6 +1676,119 @@
13
13
return NGX_OK;
14
14
}
15
15
@@ -18,29 +18,17 @@ diff -r 2e63d59c342d src/event/ngx_event_openssl.c
18
18
+ void
19
19
+ ngx_SSL_client_features(ngx_connection_t *c) {
20
20
+
21
- + unsigned short *ciphers_out = NULL;
22
21
+ int *curves_out = NULL;
23
22
+ int *point_formats_out = NULL;
24
- + size_t i = 0;
25
23
+ size_t len = 0;
24
+ + size_t i = 0;
26
25
+ SSL *s = NULL;
27
26
+
28
27
+ if (c == NULL) {
29
28
+ return;
30
29
+ }
31
30
+ s = c->ssl->connection;
32
31
+
33
- + /* Cipher suites */
34
- + c->ssl->ciphers = NULL;
35
- + c->ssl->ciphers_sz = SSL_get0_raw_cipherlist(s, &ciphers_out);
36
- + c->ssl->ciphers_sz /= 2;
37
- +
38
- + if (c->ssl->ciphers_sz && ciphers_out) {
39
- + len = c->ssl->ciphers_sz * sizeof(unsigned short);
40
- + c->ssl->ciphers = ngx_pnalloc(c->pool, len);
41
- + ngx_memcpy(c->ssl->ciphers, ciphers_out, len);
42
- + }
43
- +
44
32
+ /* Elliptic curve points */
45
33
+
46
34
+ c->ssl->curves_sz = SSL_get1_curves(s, NULL);
@@ -81,9 +69,11 @@ diff -r 2e63d59c342d src/event/ngx_event_openssl.c
81
69
+ int
82
70
+ ngx_SSL_early_cb_fn(SSL *s, int *al, void *arg) {
83
71
+
72
+ + const unsigned char *ciphers_out = NULL;
84
73
+ int got_extensions;
85
74
+ int *ext_out;
86
75
+ size_t ext_len;
76
+ + size_t len = 0;
87
77
+ ngx_connection_t *c;
88
78
+
89
79
+ c = arg;
@@ -120,13 +110,26 @@ diff -r 2e63d59c342d src/event/ngx_event_openssl.c
120
110
+
121
111
+ OPENSSL_free(ext_out);
122
112
+
113
+ +
114
+ + /* Cipher suites */
115
+ + c->ssl->ciphers = NULL;
116
+ + c->ssl->ciphers_sz = SSL_client_hello_get0_ciphers(s, &ciphers_out);
117
+ + c->ssl->ciphers_sz /= 2;
118
+ +
119
+ + if (c->ssl->ciphers_sz && ciphers_out) {
120
+ + len = c->ssl->ciphers_sz * sizeof(unsigned short);
121
+ + c->ssl->ciphers = ngx_pnalloc(c->pool, len);
122
+ + ngx_memcpy(c->ssl->ciphers, ciphers_out, len);
123
+ + }
124
+ +
125
+ +
123
126
+ return 1;
124
127
+ }
125
128
+ /* ----- JA3 HACK END -------------------------------------------------------*/
126
129
127
130
ngx_int_t
128
131
ngx_ssl_handshake(ngx_connection_t *c)
129
- @@ -1813 ,6 +1924 ,10 @@
132
+ @@ -1695 ,6 +1809 ,10 @@
130
133
131
134
ngx_ssl_clear_error(c->log);
132
135
@@ -137,7 +140,7 @@ diff -r 2e63d59c342d src/event/ngx_event_openssl.c
137
140
n = SSL_do_handshake(c->ssl->connection);
138
141
139
142
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_do_handshake: %d", n);
140
- @@ -1831 ,6 +1946 ,10 @@
143
+ @@ -1713 ,6 +1831 ,10 @@
141
144
ngx_ssl_handshake_log(c);
142
145
#endif
143
146
0 commit comments