Skip to content

Commit a072029

Browse files
committed
fix: parsing of HTTP_LOADER_VALIDATE_CERTS was broken
1 parent bd57941 commit a072029

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

thumbor/loaders/http_loader.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ async def load(
176176
user_agent = context.config.HTTP_LOADER_DEFAULT_USER_AGENT
177177

178178
url = normalize_url_func(url)
179+
180+
validate_cert = context.config.HTTP_LOADER_VALIDATE_CERTS
181+
if validate_cert is not None:
182+
validate_cert = (validate_cert.lower().strip() == "true")
183+
179184
req = tornado.httpclient.HTTPRequest(
180185
url=url,
181186
headers=headers,
@@ -191,7 +196,7 @@ async def load(
191196
ca_certs=encode_fn(context.config.HTTP_LOADER_CA_CERTS),
192197
client_key=encode_fn(context.config.HTTP_LOADER_CLIENT_KEY),
193198
client_cert=encode_fn(context.config.HTTP_LOADER_CLIENT_CERT),
194-
validate_cert=False, # TODO: check why setting HTTP_LOADER_VALIDATE_CERTS to False does not work
199+
validate_cert=validate_cert,
195200
prepare_curl_callback=prepare_curl_callback,
196201
)
197202

0 commit comments

Comments
 (0)