Skip to content

Commit

Permalink
Fixed broken client cert functionality (#333)
Browse files Browse the repository at this point in the history
It used wrong ssl options and called
ssl_create_client_context with wrong parameter order.
  • Loading branch information
cliffordjefferies authored and kernelsauce committed Jul 25, 2018
1 parent 1023f02 commit 1decb26
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions turbo/async.lua
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ function async.HTTPClient:_connect()
-- recreating new SSL contexts for every fetch.
self.ssl_options = self.ssl_options or {}
local rc, ctx_or_err = crypto.ssl_create_client_context(
self.ssl_options.priv_key,
self.ssl_options.cert_key,
self.ssl_options.cert_file,
self.ssl_options.priv_file,
self.ssl_options.ca_path,
self.ssl_options.verify_ca)
if rc ~= 0 then
Expand Down Expand Up @@ -373,8 +373,8 @@ function async.HTTPClient:_connect()
self.ssl_options = self.ssl_options or {}
crypto.ssl_init()
local rc, ctx_or_err = crypto.ssl_create_client_context(
self.ssl_options.priv_key,
self.ssl_options.cert_key,
self.ssl_options.cert_file,
self.ssl_options.priv_file,
self.ssl_options.ca_path,
self.ssl_options.verify_ca)
if rc ~= 0 then
Expand Down Expand Up @@ -597,7 +597,7 @@ function async.HTTPClient:_handle_headers(data)
self.iostream:read_until("\r\n", self._handle_chunked_encoding,
self)
else
-- No content length or chunked, no body present.
-- No content length or chunked, no body present.
self:_finalize_request()
end
return
Expand Down

0 comments on commit 1decb26

Please sign in to comment.