File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed
Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 99#endif
1010#include "ddebug.h"
1111
12-
1312#if (NGX_HTTP_SSL )
1413
14+ #include "ngx_http_lua_ssl.h"
15+
1516
1617int ngx_http_lua_ssl_ctx_index = -1 ;
1718int ngx_http_lua_ssl_key_log_index = -1 ;
@@ -46,4 +47,36 @@ ngx_http_lua_ssl_init(ngx_log_t *log)
4647}
4748
4849
50+ ngx_ssl_conn_t *
51+ ngx_http_lua_ffi_get_upstream_ssl_pointer (ngx_http_request_t * r ,
52+ const char * * err )
53+ {
54+ ngx_connection_t * c ;
55+
56+ if (r == NULL ) {
57+ * err = "bad request" ;
58+ return NULL ;
59+ }
60+
61+ if (r -> upstream == NULL ) {
62+ * err = "bad upstream" ;
63+ return NULL ;
64+ }
65+
66+ if (r -> upstream -> peer .connection == NULL ) {
67+ * err = "bad peer connection" ;
68+ return NULL ;
69+ }
70+
71+ c = r -> upstream -> peer .connection ;
72+
73+ if (c -> ssl == NULL || c -> ssl -> connection == NULL ) {
74+ * err = "not ssl connection" ;
75+ return NULL ;
76+ }
77+
78+ return c -> ssl -> connection ;
79+ }
80+
81+
4982#endif /* NGX_HTTP_SSL */
You can’t perform that action at this time.
0 commit comments