Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Add api to fetch raw nginx ssl pointer #1286

Closed

Conversation

james-callahan
Copy link
Contributor

This allows introspection of the SSL* object from lua code.

I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.

@james-callahan
Copy link
Contributor Author

Test seems to be failing for unrelated reasons.

Copy link
Member

@agentzh agentzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, we need some tests in the existing test suite to cover this change.

@@ -1319,6 +1319,21 @@ ngx_http_lua_ffi_set_priv_key(ngx_http_request_t *r,
}


int
ngx_http_lua_ffi_get_ssl_pointer(ngx_http_request_t *r,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are moving to the meta-lua-nginx-module:

https://github.com/openresty/meta-lua-nginx-module

So this change deserves supporting other subsystems as well (like the stream subsystem) if we indeed want to have this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this get added when the stream subsystem gains ssl_certificate_by_lua_block support?

{
if (r->connection == NULL || r->connection->ssl == NULL) {
*err = "bad request";
return NGX_ERROR;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to just return the SSL pointer directly and return NULL in case of errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix.

@james-callahan james-callahan force-pushed the get_ssl_pointer branch 2 times, most recently from e3ca94d to 2abdfe2 Compare March 29, 2018 02:25
@james-callahan
Copy link
Contributor Author

Test added.

@james-callahan
Copy link
Contributor Author

Is there anything blocking this PR?

@mergify
Copy link

mergify bot commented Jun 26, 2020

This pull request is now in conflict :(

@@ -1319,6 +1319,17 @@ ngx_http_lua_ffi_set_priv_key(ngx_http_request_t *r,
}


ngx_ssl_conn_t *
ngx_http_lua_ffi_get_ssl_pointer(ngx_http_request_t *r)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ngx_http_lua_ffi_get_req_ssl_ptr is a better name.

@zhuizhuhaomeng
Copy link
Contributor

merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants