From 7b3c3df4f3e26010cb60b0d716ac2a5463507164 Mon Sep 17 00:00:00 2001 From: Eloy Coto Date: Tue, 5 Nov 2019 12:51:03 +0100 Subject: [PATCH] Configuration: Lazy mode issue with SSL certificate. When Lazy mode is set and it's using SSL connection, the configuration_store was not initialized, so the config was not found and lazy mode can't found the service for the host. Fix THREESCALE-3713 Signed-off-by: Eloy Coto --- CHANGELOG.md | 2 ++ .../apicast/policy/load_configuration/load_configuration.lua | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 029b8f409..e8c20df87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +- Fix issues when TLS is enabled in Lazy mode [#1135](https://github.com/3scale/APIcast/pull/1135), [THREESCALE-3713](https://issues.jboss.org/browse/THREESCALE-3713) + ### Added - Return 404 back if the upstream is not defined [THREESCALE-3775](https://issues.jboss.org/browse/THREESCALE-3775) [PR #1129](https://github.com/3scale/APIcast/pull/1129) diff --git a/gateway/src/apicast/policy/load_configuration/load_configuration.lua b/gateway/src/apicast/policy/load_configuration/load_configuration.lua index 16e52e4bb..b86ed6c69 100644 --- a/gateway/src/apicast/policy/load_configuration/load_configuration.lua +++ b/gateway/src/apicast/policy/load_configuration/load_configuration.lua @@ -33,12 +33,13 @@ function _M:rewrite(context) context.configuration = configuration_loader.rewrite(self.configuration, context.host) end -function _M.ssl_certificate(_, context) +function _M:ssl_certificate(context) if not context.host then local server_name, err = ssl.server_name() if server_name then context.host = server_name + context.configuration = configuration_loader.rewrite(self.configuration, context.host) elseif err then ngx.log(ngx.DEBUG, 'could not get TLS SNI server name: ', err) end