@@ -94,14 +94,24 @@ start_link(SockData, Opts) ->
94
94
init ({SockMod , Socket }, Opts ) ->
95
95
TLSEnabled = proplists :get_bool (tls , Opts ),
96
96
TLSOpts1 = lists :filter (fun ({certfile , _ }) -> true ;
97
+ ({ciphers , _ }) -> true ;
97
98
(_ ) -> false
98
99
end ,
99
100
Opts ),
100
- TLSOpts2 = case proplists :get_bool (tls_compression , Opts ) of
101
- false -> [compression_none | TLSOpts1 ];
102
- true -> TLSOpts1
101
+ TLSOpts2 = case lists :keysearch (protocol_options , 1 , Opts ) of
102
+ {value , {_ , O }} ->
103
+ [_ |ProtocolOptions ] = lists :foldl (
104
+ fun (X , Acc ) -> X ++ Acc end , [],
105
+ [[" |" | binary_to_list (Opt )] || Opt <- O , is_binary (Opt )]
106
+ ),
107
+ [{protocol_options , iolist_to_binary (ProtocolOptions )} | TLSOpts1 ];
108
+ _ -> TLSOpts1
103
109
end ,
104
- TLSOpts = [verify_none | TLSOpts2 ],
110
+ TLSOpts3 = case proplists :get_bool (tls_compression , Opts ) of
111
+ false -> [compression_none | TLSOpts2 ];
112
+ true -> TLSOpts2
113
+ end ,
114
+ TLSOpts = [verify_none | TLSOpts3 ],
105
115
{SockMod1 , Socket1 } = if TLSEnabled ->
106
116
inet :setopts (Socket , [{recbuf , 8192 }]),
107
117
{ok , TLSSocket } = p1_tls :tcp_to_tls (Socket ,
0 commit comments