lua-resty-upstream-healthcheck icon indicating copy to clipboard operation
lua-resty-upstream-healthcheck copied to clipboard

Add SSL Support - completion of PR#5

Open ElvinEfendi opened this issue 7 years ago • 24 comments

This PR is based on the work done at https://github.com/openresty/lua-resty-upstream-healthcheck/pull/5.

It adds SSL support and addresses all the comments(tests and session reuse) made in the original PR.

One significant modification to the original PR is that now, the health check will fail if ssl_verify = true and the certificate verification fails.

/r @agentzh

ElvinEfendi avatar Jan 27 '17 17:01 ElvinEfendi

ping

ElvinEfendi avatar Feb 02 '17 14:02 ElvinEfendi

@agentzh Can you review?

charlescng avatar Feb 10 '17 18:02 charlescng

Also, please rebase to the latest git master.

agentzh avatar Feb 11 '17 21:02 agentzh

@ElvinEfendi Thank you for your patch! Please take care of my comments above. Thanks!

agentzh avatar Feb 11 '17 21:02 agentzh

@agentzh thanks for reviewing, I addressed your comments.

Also, please rebase to the latest git master.

I don't see any conflict with the upstream master(there were some initially but those have been sycned to this branch already). And all the commits from it are already included in this branch. Why do you think this branch is not in sync with the upstream master?

ElvinEfendi avatar Feb 15 '17 19:02 ElvinEfendi

@agentzh any more comment on this PR?

ElvinEfendi avatar Feb 22 '17 18:02 ElvinEfendi

By default peer.name(an entry defined inside upstream block as <host>:<port>) is being passed to tcpsock:sslhandshake function as server_name which is used to validate the server name specified in the server certificate sent from the remote when ssl_verify is true. Refer to https://github.com/openresty/lua-nginx-module#tcpsocksslhandshake for more information. This is a constraint when we want to share a single server certificate to do SSL health check between multiple peers. Therefore I added TEST 20 and 21 to make ssl_verify option's behaviour more clear and added a new functionality that lets users to override peer.name with a custom name set during the initialization. TEST 21 covers the new functionality. These changes are added in commit: https://github.com/openresty/lua-resty-upstream-healthcheck/pull/36/commits/ce88ef0ffc8e2230882bbb7bd83247a35e9061c6

ElvinEfendi avatar Feb 22 '17 23:02 ElvinEfendi

why this pr has not bean merged? 这个ssl support什么时候能合到主干上?

solio avatar Jun 30 '17 02:06 solio

@solio This is still in my review queue. Sorry for the delay on my side.

agentzh avatar Jul 10 '17 17:07 agentzh

@ElvinEfendi Will you please rebase to the latest git master? I'm seeing merge conflicts while rebasing it myself:

$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: add ssl support
Using index info to reconstruct a base tree...
M	README.markdown
M	lib/resty/upstream/healthcheck.lua
Falling back to patching base and 3-way merge...
Auto-merging lib/resty/upstream/healthcheck.lua
CONFLICT (content): Merge conflict in lib/resty/upstream/healthcheck.lua
Auto-merging README.markdown
error: Failed to merge in the changes.
Patch failed at 0001 add ssl support
The copy of the patch that failed is found in: .git/rebase-apply/patch

Thanks! And sorry for the delay on my side.

agentzh avatar Jul 10 '17 17:07 agentzh

Will you please rebase to the latest git master? I'm seeing merge conflicts while rebasing it myself:

Hmm I don't know why does it show conflict. There's no commit in the upstream after https://github.com/openresty/lua-resty-upstream-healthcheck/commit/69751de70d5ac6ab84947e8e074b7a14715fdb02 which is already in downstream as well https://github.com/Shopify/lua-resty-upstream-healthcheck/commit/69751de70d5ac6ab84947e8e074b7a14715fdb02.

https://github.com/openresty/lua-resty-upstream-healthcheck/compare/master...Shopify:master also shows "Able to merge": screen shot 2017-07-10 at 11 05 48 pm

ElvinEfendi avatar Jul 11 '17 03:07 ElvinEfendi

I'd also like to highlight that https://github.com/openresty/lua-resty-upstream-healthcheck/pull/36/commits/6731f959d146264e8ba1b5adbd41968deb0ae92e is not related to this PR, it is just included here because the downstream is Shopify fork's master.

If you don't want to merge that last unrelated commit, here is the PR with only SSL support: https://github.com/openresty/lua-resty-upstream-healthcheck/pull/44

ElvinEfendi avatar Jul 11 '17 03:07 ElvinEfendi

@ElvinEfendi Cool, thanks!

agentzh avatar Jul 12 '17 02:07 agentzh

hmmm, may I ping on this PR? :)

berlincount avatar Jul 17 '17 14:07 berlincount

@agentzh when do u plan to merge it? Thx

pavelnemirovsky avatar Feb 20 '18 15:02 pavelnemirovsky

Sorry, we haven't had the time to look at this. Been busy with other things with higher priority.

agentzh avatar Feb 26 '18 00:02 agentzh

@dndx @spacewander Please help review this PR once you have a chance. Thanks!

agentzh avatar Feb 26 '18 00:02 agentzh

Hi, Is there any update regarding this PR?

ricardosantosalves avatar Jun 12 '18 11:06 ricardosantosalves

Dears, any update on this feature?

gentle-king avatar Mar 25 '19 10:03 gentle-king

+1 year :-/ Would be nice to have this merged.

TWHOI avatar May 25 '20 14:05 TWHOI

@rainingmaster do you have time to take a look at this PR?

doujiang24 avatar May 25 '20 16:05 doujiang24

@agentzh is there any plan to merge this ?

leandromoreira avatar Aug 04 '21 20:08 leandromoreira

Hi @ElvinEfendi did you publish a rock with these changes? If you didn't, I'm thinking to keep a lua-resty-upstream-healthcheck-ssl repo patching your changes to the main branch of this repo, what do you think?

leandromoreira avatar Aug 05 '21 11:08 leandromoreira

I copied this PR and released it as a rock https://github.com/globocom/lua-resty-upstream-healthcheck

leandromoreira avatar Aug 06 '21 20:08 leandromoreira