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

feat(healthcheck) support to mTLS in active checks #41

Merged
merged 2 commits into from
Jun 17, 2020
Merged

Conversation

locao
Copy link
Contributor

@locao locao commented Apr 23, 2020

No description provided.

@@ -829,8 +830,16 @@ function checker:run_single_check(ip, port, hostname, hostheader)

if self.checks.active.type == "https" then
local session
session, err = sock:sslhandshake(nil, hostname,
if self.ssl_cert and self.ssl_key then
Copy link
Member

Choose a reason for hiding this comment

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

It seems that we don't need to branch here, because the ssl_cert and ssl_key are always set together. If both are not set then the client cert is not used anyway. The call to sock:sslhandshake is unnecessary for the same reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's better to keep sock:sslhandshake as a backward compatibility, as sock:tlshandshake is not available when the certificate is invalid, like this: TEST 2: active probes, invalid cert

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, sock:tlshandshake should work with or without a valid certificate. Could you elaborate?

lib/resty/healthcheck.lua Show resolved Hide resolved
@bungle
Copy link
Member

bungle commented Jun 17, 2020

This seems to be going to master but has commits with feat. Is that intent?

@locao
Copy link
Contributor Author

locao commented Jun 17, 2020

This seems to be going to master but has commits with feat. Is that intent?

This is the library master, in Kong the PR is open for next.

@locao locao merged commit 8a6360c into master Jun 17, 2020
@locao locao deleted the feat/mtls-support branch June 17, 2020 15:58
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.

None yet

3 participants