diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2013-04-09 18:17:05 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2013-04-09 18:17:05 +0100 |
| commit | a9d2b823d1b77578d9bf2ddeed3c7da2a6ca2b8a (patch) | |
| tree | fbdb8ef01db39e904dcbf37a07bc27816ccd1983 | |
| parent | 594c0677a78186eeeb7820ed4886b0ee54b9edbd (diff) | |
| download | rabbitmq-server-git-a9d2b823d1b77578d9bf2ddeed3c7da2a6ca2b8a.tar.gz | |
Be rather less arbitrary. But still a bit.
| -rw-r--r-- | src/rabbit_ssl.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rabbit_ssl.erl b/src/rabbit_ssl.erl index 0bcbc5f1fa..96277b687f 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; |
