1+ --[[
2+ Copyright (c) 2016. Adobe Systems Incorporated. All rights reserved.
3+
4+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software distributed under the License is
11+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR RESPRESENTATIONS OF ANY KIND,
12+ either express or implied. See the License for the specific language governing permissions and
13+ limitations under the License.
14+
15+ ]]
16+
117--- Base Class for working with AWS Services.
218-- It's responsible for making API Requests to most of the AWS Services
319--
@@ -13,11 +29,13 @@ local setmetatable = setmetatable
1329local error = error
1430local debug_mode = ngx .config .debug
1531local http = require " api-gateway.aws.httpclient.http"
32+ local http_resty = require " api-gateway.aws.httpclient.restyhttp"
1633local AWSV4S = require " api-gateway.aws.AwsV4Signature"
1734local IamCredentials = require " api-gateway.aws.AWSIAMCredentials"
1835local cjson = require " cjson"
1936
2037local http_client = http :new ()
38+ local http_client_resty = http_resty :new ()
2139local iam_credentials
2240
2341local function tableToString (table_ref )
@@ -98,7 +116,9 @@ function _M:debug(...)
98116end
99117
100118function _M :getHttpClient ()
101- return http_client
119+ -- return http_client -- the original http_client which will be deprecated and removed soon
120+ -- by default use the new http client that uses resty.http module
121+ return http_client_resty
102122end
103123
104124function _M :getAWSHost ()
@@ -242,6 +262,7 @@ function _M:performAction(actionName, arguments, path, http_method, useSSL, time
242262
243263 local ok , code , headers , status , body = self :getHttpClient ():request (self :getRequestObject ({
244264 scheme = scheme ,
265+ ssl_verify = false ,
245266 port = port ,
246267 timeout = timeout or 60000 ,
247268 url = request_path , -- "/"
@@ -261,9 +282,4 @@ function _M:performAction(actionName, arguments, path, http_method, useSSL, time
261282 return ok , code , headers , status , body
262283end
263284
264- return _M
265-
266-
267-
268-
269-
285+ return _M
0 commit comments