Browse Source

Merge pull request #6219 from tigercl/fix/authz-certs

fix(authz): fix badmatch when reading certs
tigercl 4 years ago
parent
commit
a074cf24d0
1 changed files with 3 additions and 2 deletions
  1. 3 2
      apps/emqx_authz/src/emqx_authz_api_sources.erl

+ 3 - 2
apps/emqx_authz/src/emqx_authz_api_sources.erl

@@ -437,10 +437,11 @@ update_config(Cmd, Sources) ->
 
 read_certs(#{<<"ssl">> := SSL} = Source) ->
     case emqx_tls_lib:file_content_as_options(SSL) of
-        {ok, NewSSL} -> Source#{<<"ssl">> => NewSSL};
         {error, Reason} ->
             ?SLOG(error, Reason#{msg => failed_to_readd_ssl_file}),
-            throw(failed_to_readd_ssl_file)
+            throw(failed_to_readd_ssl_file);
+        NewSSL ->
+            Source#{<<"ssl">> => NewSSL}
     end;
 read_certs(Source) -> Source.