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: added ssl_certificiate_by_lua* directives to allow controlling downstream SSL handshakes with Lua #637

Closed
wants to merge 73 commits into from

Conversation

agentzh
Copy link
Member

@agentzh agentzh commented Jan 3, 2016

This pull request relies on the following nginx core patch:

https://github.com/openresty/ngx_openresty/blob/master/patches/nginx-1.9.7-ssl_cert_cb_yield.patch

(already proposed to the nginx-devel mailing list: http://mailman.nginx.org/pipermail/nginx-devel/2016-January/007748.html )

This pull request couples with the ssl-cert-by-lua-2 branch of lua-resty-core. See the following pull request of lua-resty-core for the Lua API:

openresty/lua-resty-core#12

Related new documentation:

https://github.com/openresty/lua-nginx-module/tree/ssl-cert-by-lua-2#ssl_certificate_by_lua_block

See #331 for more details on the requirements and development history.

…y_lua_file directives. also added the Lua module ngx.ssl under the lua/ directory.
…y_lua_file directives. also added the Lua module ngx.ssl under the lua/ directory.
…RORS/lua-nginx-module into ssl-cert-by-lua

Conflicts:
	lua/ngx/ssl.lua
	src/ngx_http_lua_sslcertby.c
	t/130-ssl-cert-by.t
…tus_req", for sending the status request in the TLS status extension.
…p_run_posted_requests. we now avoid running the openssl handshake dispatcher directly in our fake connection's pool cleanup handler by means of posting an event.
…context. also ensure Lua runtime errors are properly propagated.
…tion fails. thanks Piotr Sikora for the report.
…lient: xxx, server: xxx" context info. thanks Piotr Sikora for the suggestion.
@agentzh
Copy link
Member Author

agentzh commented Jan 3, 2016

@lziest @lordnynex @bungle @doujiang24 @andrea-spoldi @moseleymark @marklkelly @yejingx and others (sorry if I didn't mention your names explicitly). Please review this PR for me :) Thanks!

ngx_event_handler_pt saved_read_handler;
ngx_event_handler_pt saved_write_handler;

+ void *lua_ctx; /* used by 3rd-party modules */
Copy link

Choose a reason for hiding this comment

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

so this can be removed now. right?

Copy link
Member Author

Choose a reason for hiding this comment

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

@lziest Oh, this patch is already obsolete. I've just removed the whole patch file :) Thanks for the catch.

@lziest
Copy link

lziest commented Jan 4, 2016

lgtm

@bungle
Copy link
Member

bungle commented Jan 4, 2016

Hi,

On ssl.t there are lines like this:

received: Server: nginx

Should it really be:

received: Server: openresty

@bungle
Copy link
Member

bungle commented Jan 4, 2016

If I change that received: Server thing, I still get a few errors:
https://gist.github.com/bungle/c969454d66bafbe9c046

Is it because of my configs or something? (ocsp.t runs with all test passed)

@bungle
Copy link
Member

bungle commented Jan 4, 2016

I also added some locals to ocsp.lua and ssl.lua here:
openresty/lua-resty-core#13

@agentzh agentzh mentioned this pull request Jan 4, 2016
@agentzh
Copy link
Member Author

agentzh commented Jan 4, 2016

@bungle The Server header thing is that I usually use NGINX instead of OpenResty to run those tests. In particular, I use the following script to build an NGINX to run these tests:

https://github.com/openresty/lua-nginx-module/blob/master/util/build2.sh

To run the tests on Mac OS X, we have to add 127.0.0.2 to the loopback device, via the following command:

sudo ifconfig lo0 alias 127.0.0.2 up

@agentzh
Copy link
Member Author

agentzh commented Jan 4, 2016

@bungle The failed raw_server_addr tests on Mac OS X reveal a bug in my implementation. I'll commit a fix soon :) Thanks!

… the ABI, which is not portable. thanks Aapo Talvensaari for the report.
@agentzh
Copy link
Member Author

agentzh commented Jan 5, 2016

Okay, this branch has just been merged into master. I'm closing this. Further issues should go to separate tickets :)

@agentzh agentzh closed this Jan 5, 2016
@agentzh agentzh deleted the ssl-cert-by-lua-2 branch July 20, 2016 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants