diff options
author | Ingela Anderton Andin <[email protected]> | 2017-06-10 21:47:54 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2017-06-10 21:47:54 +0200 |
commit | 14c3c0c869ff77473d9f5516fb6b2054dc64ced3 (patch) | |
tree | 4615945ab470fad3a8be99392d0bb5f274f23035 /lib/ssl/src/ssl.erl | |
parent | afd95422a9d5de847b42df2c17f9c09b13a25f3a (diff) | |
download | otp-14c3c0c869ff77473d9f5516fb6b2054dc64ced3.tar.gz otp-14c3c0c869ff77473d9f5516fb6b2054dc64ced3.tar.bz2 otp-14c3c0c869ff77473d9f5516fb6b2054dc64ced3.zip |
dtls: Handle getopts and setopts for DTLS
Diffstat (limited to 'lib/ssl/src/ssl.erl')
-rw-r--r-- | lib/ssl/src/ssl.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index 5421bdef99..75eb308ba5 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -427,6 +427,16 @@ eccs_filter_supported(Curves) -> %%-------------------------------------------------------------------- getopts(#sslsocket{pid = Pid}, OptionTags) when is_pid(Pid), is_list(OptionTags) -> ssl_connection:get_opts(Pid, OptionTags); +getopts(#sslsocket{pid = {udp, #config{transport_info = {Transport,_,_,_}}}} = ListenSocket, OptionTags) when is_list(OptionTags) -> + try dtls_socket:getopts(Transport, ListenSocket, OptionTags) of + {ok, _} = Result -> + Result; + {error, InetError} -> + {error, {options, {socket_options, OptionTags, InetError}}} + catch + _:Error -> + {error, {options, {socket_options, OptionTags, Error}}} + end; getopts(#sslsocket{pid = {_, #config{transport_info = {Transport,_,_,_}}}} = ListenSocket, OptionTags) when is_list(OptionTags) -> try tls_socket:getopts(Transport, ListenSocket, OptionTags) of @@ -455,7 +465,7 @@ setopts(#sslsocket{pid = Pid}, Options0) when is_pid(Pid), is_list(Options0) -> _:_ -> {error, {options, {not_a_proplist, Options0}}} end; -setopts(#sslsocket{pid = {{udp, _}, #config{transport_info = {Transport,_,_,_}}}} = ListenSocket, Options) when is_list(Options) -> +setopts(#sslsocket{pid = {udp, #config{transport_info = {Transport,_,_,_}}}} = ListenSocket, Options) when is_list(Options) -> try dtls_socket:setopts(Transport, ListenSocket, Options) of ok -> ok; |