diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2013-04-09 17:48:31 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2013-04-09 17:48:31 +0100 |
commit | 1e731ffa29684325053caf4b4ce88f4d4be52f5b (patch) | |
tree | 17e57f32967be042864ec1a3dcabbafae158d3df | |
parent | 16959fe509d2d36c85fb5a2a6b14d7ab0211a74a (diff) | |
download | rabbitmq-server-1e731ffa29684325053caf4b4ce88f4d4be52f5b.tar.gz |
Insert a hack.
-rw-r--r-- | src/rabbit_ssl.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rabbit_ssl.erl b/src/rabbit_ssl.erl index 7c9e6027..c769f35d 100644 --- a/src/rabbit_ssl.erl +++ b/src/rabbit_ssl.erl @@ -210,6 +210,16 @@ format_asn1_value({utcTime, [Y1, Y2, M1, M2, D1, D2, H1, H2, %% (e.g. domainComponent). format_asn1_value(V) when is_list(V) -> 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. + try + public_key:der_decode('CommonName', V) + catch _:_ -> + rabbit_misc:format("~p", [V]) + end; format_asn1_value(V) -> rabbit_misc:format("~p", [V]). |