anchor.diff:                                [binary, {active, false}, {packet, raw},
                                  {verify, verify_peer},
                                  {cacerts, load_cacerts()},
  -                               {certfile, "../../test/ssl/client-revoked.crt"},
  -                               {keyfile, "../../test/ssl/client.key"}])).
  +                               {certfile, ssl_path("client-revoked.crt")},
  +                               {keyfile, ssl_path("client.key")}])).
   
   connect_cert_auth_crl_test(_) ->
       Connect = packet:gen_connect("connect-success-test", [{keepalive, 10}]),
  
positive.code:                               [binary, {active, false}, {packet, raw},
                                 {verify, verify_peer},
                                 {cacerts, load_cacerts()},
                                 {certfile, "../../test/ssl/client-expired.crt"},
                                 {keyfile, "../../test/ssl/client.key"}])).
  
  connect_cert_auth_revoked_test(_) ->
      assert_error_or_closed({error,{tls_alert,"certificate revoked"}},
  
negative.code:             {ok, _} = vmq_server_cmd:set_config(allow_anonymous, true),
              {ok, _} = vmq_server_cmd:listener_start(1888, [{ssl, true},
                                                             {nr_of_acceptors, 5},
                                                             {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, 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, ssl_path("all-ca.crt")},
                                                             {certfile, ssl_path("server.crt")},
                                                             {keyfile, ssl_path("server.key")},
                                                             {tls_version, "tlsv1.2"},
                                                             {require_certificate, true},
                                                             {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, ssl_path("all-ca.crt")},
                                                             {certfile, ssl_path("server.crt")},
                                                             {keyfile, ssl_path("server.key")},
                                                             {tls_version, "tlsv1.2"},
                                                             {require_certificate, true},
                                                             {crlfile, ssl_path("crl.pem")},
                                                             {use_identity_as_username, true}]),
              vmq_plugin_mgr:enable_module_plugin(
                auth_on_register, ?MODULE, hook_preauth_success, 5)
  