@@ -538,7 +538,6 @@ connect(Parent, N, PubSub, Opts) ->
538538 Prometheus = lists :member (prometheus , Opts ),
539539 GoSignalPid = proplists :get_value (publish_signal_pid , Opts ),
540540 SendGoSignal = proplists :get_value (send_go_signal , Opts ),
541- IsQuic = is_quic (Opts ),
542541 MRef = case is_pid (GoSignalPid ) of
543542 true -> monitor (process , GoSignalPid );
544543 _ -> undefined
@@ -578,7 +577,7 @@ connect(Parent, N, PubSub, Opts) ->
578577 case ConnRet of
579578 {ok , _Props } ->
580579 inc_counter (Prometheus , connect_succ ),
581- ( not IsQuic ) andalso maybe_record_keylogfile (Client ),
580+ _ = maybe_record_keylogfile (Client , Opts ),
582581 Res =
583582 case PubSub of
584583 conn ->
@@ -995,10 +994,8 @@ ssl_opts([{sslversion, Vsn} | Opts], Acc) ->
995994 ssl_opts (Opts , [{versions , [Vsn ]} | Acc ]);
996995ssl_opts ([{ssl , IsSSL } | Opts ], Acc ) when is_boolean (IsSSL ) ->
997996 ssl_opts (Opts , Acc );
998- ssl_opts ([{nst_dets_file , DetsFile }| Opts ], Acc ) ->
999- ok = prepare_nst (DetsFile ),
1000- io :format (" enable session_tickets~n " ),
1001- ssl_opts (Opts , [{session_tickets , manual }|Acc ]);
997+ ssl_opts ([{nst_dets_file , _DetsFile }| Opts ], Acc ) ->
998+ ssl_opts (Opts , [{session_tickets , manual } | Acc ]);
1002999ssl_opts ([{ciphers , Ciphers }| Opts ], Acc ) ->
10031000 CipherList = [ssl :str_to_suite (X ) || X <- string :tokens (Ciphers , " ," )],
10041001 ssl_opts (Opts , [{ciphers , CipherList } | Acc ]);
@@ -1552,6 +1549,10 @@ maybe_prefix_payload(Payload, ClientOpts) ->
15521549is_quic (Opts ) ->
15531550 proplists :get_value (quic , Opts ) =/= false .
15541551
1552+ - spec is_tls (proplists :proplist ()) -> boolean ().
1553+ is_tls (Opts ) ->
1554+ proplists :get_bool (ssl , Opts ).
1555+
15551556quic_opts_from_arg (Opts )->
15561557 case proplists :get_value (quic , Opts ) of
15571558 V when is_boolean (V ) ->
@@ -1584,11 +1585,13 @@ prepare_quicer(Opts) ->
15841585 end .
15851586
15861587% % @doc write SSL keylog file, for Wireshark TLS decryption.
1587- % % SSL only, doesn't work for other transport
1588+ % % SSL only, doesn't work for other transports
15881589% % @end
1589- - spec maybe_record_keylogfile (emqtt :client ()) -> ok .
1590- maybe_record_keylogfile (Client ) when is_pid (Client ) ->
1591- do_write_keylogfile (persistent_term :get (sslkeylogfile , false ), Client ).
1590+ - spec maybe_record_keylogfile (emqtt :client (), proplists :proplist ()) -> _ .
1591+ maybe_record_keylogfile (Client , Opts ) when is_pid (Client ) ->
1592+ is_tls (Opts ) andalso
1593+ not is_quic (Opts ) andalso
1594+ do_write_keylogfile (persistent_term :get (sslkeylogfile , false ), Client ).
15921595do_write_keylogfile (false , _Client ) ->
15931596 ok ;
15941597do_write_keylogfile (Keylogpath , Client ) ->
0 commit comments