mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-12 21:52:07 +02:00
When using OTP R14, use public_key library instead of old ssl (EJAB-953)
This commit is contained in:
parent
5a8d99232c
commit
f8412d7c5d
|
@ -50,9 +50,9 @@
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
-include("ejabberd.hrl").
|
||||||
-include("XmppAddr.hrl").
|
-include("XmppAddr.hrl").
|
||||||
-include_lib("ssl/include/ssl_pkix.hrl").
|
-include_lib("public_key/include/public_key.hrl").
|
||||||
-define(PKIXEXPLICIT, 'OTP-PKIX').
|
-define(PKIXEXPLICIT, 'OTP-PUB-KEY').
|
||||||
-define(PKIXIMPLICIT, 'OTP-PKIX').
|
-define(PKIXIMPLICIT, 'OTP-PUB-KEY').
|
||||||
|
|
||||||
-define(DICT, dict).
|
-define(DICT, dict).
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,8 @@
|
||||||
-define(GET_VERIFY_RESULT, 8).
|
-define(GET_VERIFY_RESULT, 8).
|
||||||
-define(VERIFY_NONE, 16#10000).
|
-define(VERIFY_NONE, 16#10000).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-record(tlssock, {tcpsock, tlsport}).
|
-record(tlssock, {tcpsock, tlsport}).
|
||||||
|
|
||||||
start() ->
|
start() ->
|
||||||
|
@ -232,7 +234,7 @@ close(#tlssock{tcpsock = TCPSocket, tlsport = Port}) ->
|
||||||
get_peer_certificate(#tlssock{tlsport = Port}) ->
|
get_peer_certificate(#tlssock{tlsport = Port}) ->
|
||||||
case port_control(Port, ?GET_PEER_CERTIFICATE, []) of
|
case port_control(Port, ?GET_PEER_CERTIFICATE, []) of
|
||||||
<<0, BCert/binary>> ->
|
<<0, BCert/binary>> ->
|
||||||
case catch ssl_pkix:decode_cert(BCert, [pkix]) of
|
case catch public_key:pkix_decode_cert(BCert, plain) of
|
||||||
{ok, Cert} ->
|
{ok, Cert} ->
|
||||||
{ok, Cert};
|
{ok, Cert};
|
||||||
_ ->
|
_ ->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user