File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 2020
2121#if (NGX_STREAM_SSL )
2222
23+ #include "ngx_stream_lua_ssl.h"
24+
2325
2426int ngx_stream_lua_ssl_ctx_index = -1 ;
2527int ngx_stream_lua_ssl_key_log_index = -1 ;
@@ -58,4 +60,32 @@ ngx_stream_lua_ssl_init(ngx_log_t *log)
5860}
5961
6062
63+ ngx_ssl_conn_t *
64+ ngx_stream_lua_ffi_get_upstream_ssl_pointer (ngx_stream_lua_request_t * r ,
65+ const char * * err )
66+ {
67+ ngx_connection_t * c ;
68+
69+ if (r == NULL || r -> connection == NULL || r -> session == NULL ) {
70+ * err = "bad request" ;
71+ return NULL ;
72+ }
73+
74+ if (r -> session -> upstream == NULL
75+ || r -> session -> upstream -> peer .connection == NULL ) {
76+ * err = "not upstream" ;
77+ return NULL ;
78+ }
79+
80+ c = r -> session -> upstream -> peer .connection ;
81+
82+ if (c -> ssl == NULL || c -> ssl -> connection == NULL ) {
83+ * err = "not ssl connection" ;
84+ return NULL ;
85+ }
86+
87+ return c -> ssl -> connection ;
88+ }
89+
90+
6191#endif /* NGX_STREAM_SSL */
You can’t perform that action at this time.
0 commit comments