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

Openresty update: Fix issues with ssl_cert context #1283

Merged
merged 1 commit into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed IPcheck policy issues with invalid IP [PR #1273](https://github.com/3scale/APIcast/pull/1273) [THREESCALE-7075](https://issues.redhat.com/browse/THREESCALE-7075)
- Disabled content-caching globally if no policy at all [PR #1278](https://github.com/3scale/APIcast/pull/1278) [THREESCALE-7016](https://issues.redhat.com/browse/THREESCALE-7016)
- Fixed warning messages [PR #1282](https://github.com/3scale/APIcast/pull/1282) [THREESCALE-5816](https://issues.redhat.com/browse/THREESCALE-5816)
- Fixed lua socket error on ssl_certificate [PR #1283](https://github.com/3scale/APIcast/pull/1283) [THREESCALE-7230](https://issues.redhat.com/browse/THREESCALE-7230)

### Added

Expand Down
7 changes: 7 additions & 0 deletions gateway/src/resty/resolver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ function _M:instance()
if not resolver then
local dns = dns_client:instance(self.nameservers())
resolver = self.new(dns)
end

-- This condition is a bit hacky, but when using UDP cosockets on ssl_cert
-- phase, it'll be closed for other phases, so skip to share on the ssl_cert
-- case.
-- Check THREESCALE-7230 for more info.
if ngx.get_phase() ~= "ssl_cert" then
ctx.resolver = resolver
end

Expand Down
7 changes: 7 additions & 0 deletions gateway/src/resty/resolver/dns_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ function _M:instance(nameservers)

if not resolver then
resolver = self:new({ nameservers = nameservers })
end

-- This condition is a bit hacky, but when using UDP cosockets on ssl_cert
-- phase, it'll be closed for other phases, so skip to share on the ssl_cert
-- case.
-- Check THREESCALE-7230 for more info.
if ngx.get_phase() ~= "ssl_cert" then
ctx.dns = resolver
end

Expand Down