summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-04-09 18:17:05 +0100
committerSimon MacMullen <simon@rabbitmq.com>2013-04-09 18:17:05 +0100
commitd5f090520c771a70e0349923cc973512142293a7 (patch)
treefbdb8ef01db39e904dcbf37a07bc27816ccd1983
parent7e1c3ef4831ca32b38522e1913d3c0a3a18e1dda (diff)
downloadrabbitmq-server-d5f090520c771a70e0349923cc973512142293a7.tar.gz
Be rather less arbitrary. But still a bit.
-rw-r--r--src/rabbit_ssl.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rabbit_ssl.erl b/src/rabbit_ssl.erl
index 0bcbc5f1..96277b68 100644
--- a/src/rabbit_ssl.erl
+++ b/src/rabbit_ssl.erl
@@ -214,12 +214,12 @@ format_asn1_value(V) when is_list(V) ->
format_asn1_value(V) when is_binary(V) ->
%% OTP does not decode some values when combined with an unknown
%% type. That's probably wrong, so as a last ditch effort let's
- %% try manually decoding. This is certainly not guaranteed to work
- %% in all cases, but if we have a printableString we're in luck.
- %% 'CommonName' is somewhat arbitrary - we need a valid type, and
- %% der_decode/2 will do some type checking against it.
+ %% try manually decoding. 'DirectoryString' is semi-arbitrary -
+ %% but it is the type which covers the various string types we
+ %% handle below.
try
- public_key:der_decode('CommonName', V)
+ {ST, S} = public_key:der_decode('DirectoryString', V),
+ format_directory_string(ST, S)
catch _:_ ->
rabbit_misc:format("~p", [V])
end;