Skip to content

Commit 57dae62

Browse files
catbro666pintsized
authored andcommitted
apply comments
1 parent 5455eee commit 57dae62

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/resty/http_connect.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,13 @@ local function connect(self, options)
244244
end
245245

246246
cert_hash, err = cert:digest("sha256")
247-
if cert_hash then
248-
cert_hash = to_hex(cert_hash) -- convert to hex so that it's printable
249-
250-
else
247+
if not cert_hash then
251248
ngx_log(ngx_WARN, "failed to calculate the digest of the cert, falling back to non-mTLS: ", err)
252249
break
253250
end
254251

252+
cert_hash = to_hex(cert_hash) -- convert to hex so that it's printable
253+
255254
until true
256255
end
257256

@@ -265,10 +264,10 @@ local function connect(self, options)
265264
poolname = string_format("%s:%s:%s:%s:%s:%s:%s:%s:%s",
266265
request_scheme or "",
267266
request_host,
268-
tostring(request_port),
269-
tostring(ssl),
267+
request_port,
268+
ssl,
270269
ssl_server_name or "",
271-
tostring(ssl_verify),
270+
ssl_verify,
272271
proxy_uri or "",
273272
request_scheme == "https" and proxy_authorization or "",
274273
cert_hash or "")

0 commit comments

Comments
 (0)