From 88e11105df50571294cac555b4bf59e7cce15623 Mon Sep 17 00:00:00 2001 From: Hans Svensson Date: Wed, 25 Mar 2020 11:58:05 +0100 Subject: [PATCH] Testing against TLS-enabled Riak nodes --- priv/phoney_cert.pem | 49 ++++++++++++++++++++++++++++++++++++++++++++ priv/riak_ssl.conf | 5 +++++ rebar.config | 3 ++- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 priv/phoney_cert.pem create mode 100644 priv/riak_ssl.conf diff --git a/priv/phoney_cert.pem b/priv/phoney_cert.pem new file mode 100644 index 000000000..161361093 --- /dev/null +++ b/priv/phoney_cert.pem @@ -0,0 +1,49 @@ +-----BEGIN CERTIFICATE----- +MIIDbjCCAlYCCQCAvNvby7tjaDANBgkqhkiG9w0BAQsFADB5MQswCQYDVQQGEwJT +RTEMMAoGA1UECAwDTi9BMRMwEQYDVQQHDApHb3RoZW5idXJnMRUwEwYDVQQKDAxF +eGFtcGxlLCBMTEMxETAPBgNVBAMMCFF1dmlxIEFCMR0wGwYJKoZIhvcNAQkBFg5j +ZXJ0QHF1dmlxLmNvbTAeFw0yMDAyMjQxMzIxMjVaFw0yMTAyMjMxMzIxMjVaMHkx +CzAJBgNVBAYTAlNFMQwwCgYDVQQIDANOL0ExEzARBgNVBAcMCkdvdGhlbmJ1cmcx +FTATBgNVBAoMDEV4YW1wbGUsIExMQzERMA8GA1UEAwwIUXV2aXEgQUIxHTAbBgkq +hkiG9w0BCQEWDmNlcnRAcXV2aXEuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAm3Gp3Vmr+jQOut67+h9e7G0u4E2tE8GmTNA/g60vwE6aHkBsQxHz +Xz5OuRCLQZdVgK31Ex+fSHbJZ7xf7HotpN/byzT2H2O6JnTA5yWAVyQmqd45r8eN +4+CsNl4YLDBArFwfadFC6thGfjKPcM5VmgjWrzSfrQg8AgSphsb3zXViLPxMdU1R +E/94/TOmRG6MA4en4wkEsjjspHH1GnzpuLYTTD/HvwpF/PWwchjb9NMo71j0v7ja +P3s605FRqcukgJz7gZ7Qv+e05UfOC2YuSCEshxHsoiaRy9hsN971kDtmmcj6w0zy +SVGa8URCXYDmueSfeFvcrdvsSHz2E2o9owIDAQABMA0GCSqGSIb3DQEBCwUAA4IB +AQA4vegr55hJHbecx8ry7xBizlK33nDVaZkkMyDy/RiJoj1mlNtTRjLLvSbVe68x +rtsAvEaBu6yPJTn+8x8HqH73eVsMYrB5XRLMNNzWE1Dn1bMwXYfLFg8GLh1U8JDS +1hzOjlWdvjXPE545N0OU8Fv2YWoRp0B7okvoQEoUahx0Wd0HIdBjZMbv1JiV+qi6 +7PnUak2AQxddyolwOmgZrF+ssXhfOkd0XuYsn8ycrFoTjmJujxnEzjA7twIjllw1 +kPw0qy6kpa7VZnjL3stNSl3g3nupLm/SL1wckZrTQs+3qEPLf5R/GyTMC4v22DMZ +dR70apXT2gF7BbTKAhLGx7IJ +-----END CERTIFICATE----- +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCbcandWav6NA66 +3rv6H17sbS7gTa0TwaZM0D+DrS/ATpoeQGxDEfNfPk65EItBl1WArfUTH59Idsln +vF/sei2k39vLNPYfY7omdMDnJYBXJCap3jmvx43j4Kw2XhgsMECsXB9p0ULq2EZ+ +Mo9wzlWaCNavNJ+tCDwCBKmGxvfNdWIs/Ex1TVET/3j9M6ZEbowDh6fjCQSyOOyk +cfUafOm4thNMP8e/CkX89bByGNv00yjvWPS/uNo/ezrTkVGpy6SAnPuBntC/57Tl +R84LZi5IISyHEeyiJpHL2Gw33vWQO2aZyPrDTPJJUZrxREJdgOa55J94W9yt2+xI +fPYTaj2jAgMBAAECggEAZVZbfB+qm2n2tGLiv3RWKOIhLj/VdszHQsp8rbZpLADS +PqiXK753H/95yPJ9JpynNEW0QOxbph0yvjszefJI8XSzUK3NSrd0Mv/ohoiPO8Ao +qJNknjEFUqs0+hirv5sRfoxsOksfSgUHJ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h7ODr+2KSCXlCLn5I+mCSo= +-----END PRIVATE KEY----- diff --git a/priv/riak_ssl.conf b/priv/riak_ssl.conf new file mode 100644 index 000000000..94e77a38d --- /dev/null +++ b/priv/riak_ssl.conf @@ -0,0 +1,5 @@ +[{server, + [{certfile, "./priv/phoney_cert.pem"}, + {secure_renegotiate, true}]}, + {client, + [{secure_renegotiate, true}]}]. diff --git a/rebar.config b/rebar.config index 316d92d04..6f3ad0d0f 100644 --- a/rebar.config +++ b/rebar.config @@ -24,7 +24,8 @@ ]}. {escript_incl_apps, [goldrush, lager, getopt, riakhttpc, riakc, ibrowse, mochiweb, kvc, kv_index_tictactree]}. -{escript_emu_args, "%%! -escript main riak_test_escript +K true +P 10000 -env ERL_MAX_PORTS 10000\n"}. +%% {escript_emu_args, "%%! -escript main riak_test_escript +K true +P 10000 -env ERL_MAX_PORTS 10000\n"}. +{escript_emu_args, "%%! -escript main riak_test_escript +K true +P 10000 -proto_dist inet_tls -ssl_dist_optfile ./priv/riak_ssl.conf -env ERL_MAX_PORTS 10000\n"}. {post_hooks, [{"(linux|darwin|solaris|freebsd|netbsd|openbsd)", escriptize,