Skip to content

Commit

Permalink
better ssl handshake error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Jul 15, 2015
1 parent f4c9602 commit c50db93
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cassandra/session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,15 @@ function _M:connect(contact_points, port, options)
}

self.socket = ssl.wrap(self.socket, params)
ok = self.socket:dohandshake()
ok, err = self.socket:dohandshake()
if not ok then
return false, cerror("Invalid handshake")
return false, cerror(err)
end
else
self.socket:sslhandshake(nil, nil, options.ssl_verify)
ok, err = self.socket:sslhandshake(false, nil, options.ssl_verify)
if not ok then
return false, cerror(err)
end
end
end

Expand Down

0 comments on commit c50db93

Please sign in to comment.