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 | 3d1b5cb54cd1104f0e29ff44ca0f9ee829915714 (patch) | |
| tree | 17e57f32967be042864ec1a3dcabbafae158d3df | |
| parent | e09f08fc727f03c7bb931f7c36bdf0003e85f816 (diff) | |
| download | rabbitmq-server-git-3d1b5cb54cd1104f0e29ff44ca0f9ee829915714.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 7c9e60276d..c769f35de7 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]). |
