Skip to content

Commit

Permalink
Configuration: Lazy mode issue with SSL certificate.
Browse files Browse the repository at this point in the history
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 <eloy.coto@gmail.com>
  • Loading branch information
eloycoto committed Nov 5, 2019
1 parent 5bb5a2b commit 7b3c3df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b3c3df

Please sign in to comment.