Skip to content

Commit

Permalink
Convert user and password types in riakc_pb_socket:start_auth.
Browse files Browse the repository at this point in the history
The #state.credentials field is declared as {User::string(),
Password::string()} but the rpbauthreq record's user and password
fields are declared as binary.  Call iolist_to_binary to convert.
  • Loading branch information
David Hull committed Jan 30, 2018
1 parent 7a4552d commit 589c1b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/riakc_pb_socket.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2272,8 +2272,8 @@ start_tls(State=#state{sock=Sock}) ->
end.

start_auth(State=#state{credentials={User,Pass}, sock=Sock}) ->
ok = ssl:send(Sock, riak_pb_codec:encode(#rpbauthreq{user=User,
password=Pass})),
ok = ssl:send(Sock, riak_pb_codec:encode(#rpbauthreq{user=iolist_to_binary(User),
password=iolist_to_binary(Pass)})),
receive
{ssl_error, Sock, Reason} ->
{error, Reason};
Expand Down

0 comments on commit 589c1b5

Please sign in to comment.