anchor.diff:              {ok, _} = vmq_server_cmd:set_config(allow_anonymous, true),
               {ok, _} = vmq_server_cmd:listener_start(1888, [{ssl, true},
                                                              {nr_of_acceptors, 5},
  -                                                           {cafile, "../../test/ssl/all-ca.crt"},
  -                                                           {certfile, "../../test/ssl/server.crt"},
  -                                                           {keyfile, "../../test/ssl/server.key"},
  +                                                           {cafile, ssl_path("all-ca.crt")},
  +                                                           {certfile, ssl_path("server.crt")},
  +                                                           {keyfile, ssl_path("server.key")},
                                                              {tls_version, "tlsv1.2"}]);
           {_, true, _, _} ->
               {ok, _} = vmq_server_cmd:set_config(allow_anonymous, true),
               {ok, _} = vmq_server_cmd:listener_start(1888, [{ssl, true},
                                                              {nr_of_acceptors, 5},
  -                                                           {cafile, "../../test/ssl/all-ca.crt"},
  -                                                           {certfile, "../../test/ssl/server.crt"},
  -                                                           {keyfile, "../../test/ssl/server.key"},
  +                                                           {cafile, ssl_path("all-ca.crt")},
  +                                                           {certfile, ssl_path("server.crt")},
  +                                                           {keyfile, ssl_path("server.key")},
                                                              {tls_version, "tlsv1.2"},
                                                              {require_certificate, true}]);
           {_, _, true, _} ->
               {ok, _} = vmq_server_cmd:set_config(allow_anonymous, true),
               {ok, _} = vmq_server_cmd:listener_start(1888, [{ssl, true},
                                                              {nr_of_acceptors, 5},
  -                                                           {cafile, "../../test/ssl/all-ca.crt"},
  -                                                           {certfile, "../../test/ssl/server.crt"},
  -                                                           {keyfile, "../../test/ssl/server.key"},
  +                                                           {cafile, ssl_path("all-ca.crt")},
  +                                                           {certfile, ssl_path("server.crt")},
  +                                                           {keyfile, ssl_path("server.key")},
                                                              {tls_version, "tlsv1.2"},
                                                              {require_certificate, true},
  -                                                           {crlfile, "../../test/ssl/crl.pem"}]);
  +                                                           {crlfile, ssl_path("crl.pem")}]);
           {_, _, _, true} ->
               {ok, _} = vmq_server_cmd:set_config(allow_anonymous, false),
               {ok, _} = vmq_server_cmd:listener_start(1888, [{ssl, true},
                                                              {nr_of_acceptors, 5},
  -                                                           {cafile, "../../test/ssl/all-ca.crt"},
  -                                                           {certfile, "../../test/ssl/server.crt"},
  -                                                           {keyfile, "../../test/ssl/server.key"},
  +                                                           {cafile, ssl_path("all-ca.crt")},
  +                                                           {certfile, ssl_path("server.crt")},
  +                                                           {keyfile, ssl_path("server.key")},
                                                              {tls_version, "tlsv1.2"},
                                                              {require_certificate, true},
  -                                                           {crlfile, "../../test/ssl/crl.pem"},
  +                                                           {crlfile, ssl_path("crl.pem")},
                                                              {use_identity_as_username, true}]),
               vmq_plugin_mgr:enable_module_plugin(
                 auth_on_register, ?MODULE, hook_preauth_success, 5)
  
positive.code:                   ssl:connect("localhost", 1888,
                                [binary, {active, false}, {packet, raw},
                                 {verify, verify_peer},
                                 {cacertfile, "../../test/ssl/test-alt-ca.crt"}])).
  
  connect_cert_auth_test(_) ->
      Connect = packet:gen_connect("connect-success-test", [{keepalive, 10}]),
  
negative.code:                     Contents, Type == 'Certificate',
                      Cipher == 'not_encrypted']
      end.
  
  ssl_path(File) ->
      Path = filename:dirname(
               proplists:get_value(source, ?MODULE:module_info(compile))),
      filename:join([Path, "ssl", File]).
  