Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start ssl when using secure connection with riakc_pb #232

Open
wants to merge 1 commit into
base: develop-3.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ PKG_ID = basho-bench-$(PKG_VERSION)
PKG_BUILD = 1
BASE_DIR = $(shell pwd)
ERLANG_BIN = $(shell dirname $(shell which erl))
REBAR ?= $(BASE_DIR)/rebar
REBAR ?= $(BASE_DIR)/rebar3
OVERLAY_VARS ?=


all: deps compile
$(REBAR) skip_deps=true escriptize
$(REBAR) escriptize

.PHONY: deps compile rel lock locked-all locked-deps

Expand Down
8 changes: 7 additions & 1 deletion src/basho_bench_driver_riakc_pb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ new(Id) ->
Targets = basho_bench_config:normalize_ips(Ips, Port),
{TargetIp, TargetPort} = lists:nth((Id rem length(Targets)+1), Targets),
?INFO("Using target ~p:~p for worker ~p\n", [TargetIp, TargetPort, Id]),
case riakc_pb_socket:start_link(TargetIp, TargetPort, get_connect_options()) of

Options = get_connect_options(),
case proplists:is_defined(cacertfile, Options) of
true -> ssl:start();
_ -> ok
end,
case riakc_pb_socket:start_link(TargetIp, TargetPort, Options) of
{ok, Pid} ->
NominatedID = Id == 1,
{ok, #state { pid = Pid,
Expand Down