summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2010-10-01 11:42:37 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2010-10-01 11:42:37 +0100
commit58b814c06882014d3d6bc63a77e93e6fe28ce2ed (patch)
tree23f402ef6986959c7fdbf3d8facbb7fcd88c8110
parenta31f800b002405c654fe043816cd69057fb9a2ee (diff)
downloadrabbitmq-server-git-58b814c06882014d3d6bc63a77e93e6fe28ce2ed.tar.gz
support for R14B; fix utf8 bug
-rw-r--r--src/rabbit_ssl.erl12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rabbit_ssl.erl b/src/rabbit_ssl.erl
index ba50a8deb1..657a01152f 100644
--- a/src/rabbit_ssl.erl
+++ b/src/rabbit_ssl.erl
@@ -85,8 +85,10 @@ peer_cert_validity(Cert) ->
%%--------------------------------------------------------------------------
cert_info(F, Cert) ->
- {ok, DecCert} = public_key:pkix_decode_cert(Cert, otp),
- F(DecCert).
+ F(case public_key:pkix_decode_cert(Cert, otp) of
+ {ok, DecCert} -> DecCert;
+ DecCert -> DecCert
+ end).
%%--------------------------------------------------------------------------
%% Formatting functions
@@ -158,9 +160,11 @@ escape_rdn_value([C | S], middle) ->
%% Get the string representation of an OTPCertificate field.
format_asn1_value({ST, S}) when ST =:= teletexString; ST =:= printableString;
- ST =:= universalString; ST =:= utf8string;
+ ST =:= universalString; ST =:= utf8String;
ST =:= bmpString ->
- S;
+ if is_binary(S) -> binary_to_list(S);
+ true -> S
+ end;
format_asn1_value({utcTime, [Y1, Y2, M1, M2, D1, D2, H1, H2,
Min1, Min2, S1, S2, $Z]}) ->
io_lib:format("20~c~c-~c~c-~c~cT~c~c:~c~c:~c~cZ",