Skip to content

Commit

Permalink
Add sock:peercert/1
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwin Fine committed Sep 1, 2016
1 parent 049f3f3 commit 63c9460
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sock.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
recv/3,
close/1,
peername/1,
peercert/1,
setopts/2
]).

Expand Down Expand Up @@ -61,6 +62,11 @@ peername({ssl, Socket}) ->
peername({gen_tcp, Socket}) ->
inet:peername(Socket).

peercert({ssl, Socket}) ->
ssl:peercert(Socket);
peercert({gen_tcp, _Socket}) ->
{error, unsupported}.

setopts({ssl, Socket}, Opts) ->
ssl:setopts(Socket, Opts);
setopts({gen_tcp, Socket}, Opts) ->
Expand Down

0 comments on commit 63c9460

Please sign in to comment.