Skip to content

Commit 85ca782

Browse files
committed
fix(request) enable tls name verification
1 parent 8af9b0b commit 85ca782

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ See [the example](https://kong.github.io/lua-resty-aws/classes/AWS.html) in the
3636
This typically happens when initializing from within a `require` call.
3737
See [Global settings](#global-settings) below on how to initialize properly.
3838

39+
### TLS and certificate failures
40+
41+
The http client defaults to tls name verification. For this to work, the CA store must be set.
42+
With OpenResty this is done through the [`lua_ssl_trusted_certificate`](https://github.com/openresty/lua-nginx-module#lua_ssl_trusted_certificate)
43+
directive. However; the compatibility module used, [`lua-resty-luasocket`](https://github.com/Tieske/lua-resty-luasocket), cannot automatically
44+
read that setting, hence you have to set it manually, see [the docs](https://tieske.github.io/lua-resty-luasocket/modules/resty.luasocket.html#get_luasec_defaults).
45+
3946
### Global settings
4047

4148
This library depends on global settings. Especially the core services for authentication
@@ -152,6 +159,9 @@ Release process:
152159

153160
### unreleased
154161

162+
- **IMPORTANT-IMPORTANT-IMPORTANT** feat: enable TLS name verification. This might
163+
break if your CA store is not the default system one. See [usage notes](#usage-important).
164+
[#47](https://github.com/Kong/lua-resty-aws/pull/47)
155165
- fix: STS regional endpoints woudl re-inject the region on every authentication
156166
(after a token expired), causing bad hostnames to be used
157167
[#45](https://github.com/Kong/lua-resty-aws/issues/45)

src/resty/aws/request/execute.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ local function execute_request(signed_request)
2222
port = signed_request.port,
2323
scheme = signed_request.tls and "https" or "http",
2424
ssl_server_name = signed_request.host,
25-
ssl_verify = false, -- TODO: added after updating lua-resty-http which now defaults to "true" and breaks stuff, needs to be fixed!!
25+
ssl_verify = true,
2626
}
2727
if not ok then
2828
return nil, ("failed to connect to '%s://%s:%s': %s"):format(

0 commit comments

Comments
 (0)