25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

When using OTP R14, use public_key library instead of old ssl (EJAB-953)

This commit is contained in:
Badlop 2010-07-09 20:18:59 +02:00
parent 5a8d99232c
commit f8412d7c5d
2 changed files with 6 additions and 4 deletions

View File

@ -50,9 +50,9 @@
-include("ejabberd.hrl").
-include("XmppAddr.hrl").
-include_lib("ssl/include/ssl_pkix.hrl").
-define(PKIXEXPLICIT, 'OTP-PKIX').
-define(PKIXIMPLICIT, 'OTP-PKIX').
-include_lib("public_key/include/public_key.hrl").
-define(PKIXEXPLICIT, 'OTP-PUB-KEY').
-define(PKIXIMPLICIT, 'OTP-PUB-KEY').
-define(DICT, dict).

View File

@ -61,6 +61,8 @@
-define(GET_VERIFY_RESULT, 8).
-define(VERIFY_NONE, 16#10000).
-record(tlssock, {tcpsock, tlsport}).
start() ->
@ -232,7 +234,7 @@ close(#tlssock{tcpsock = TCPSocket, tlsport = Port}) ->
get_peer_certificate(#tlssock{tlsport = Port}) ->
case port_control(Port, ?GET_PEER_CERTIFICATE, []) of
<<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};
_ ->