summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-04-05 16:57:44 +0100
committerSimon MacMullen <simon@rabbitmq.com>2011-04-05 16:57:44 +0100
commit8745389ddb413ed3a326f2c4a989f7ad2e7105ce (patch)
treea3c8a92e9c1ad7eced81c47657a551a8f0c3fb84
parent2b965cec2671c62be3994bfb013e6eec0a7caac2 (diff)
downloadrabbitmq-server-8745389ddb413ed3a326f2c4a989f7ad2e7105ce.tar.gz
UTF8strings come back as binaries.bug24017
-rw-r--r--src/rabbit_ssl.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rabbit_ssl.erl b/src/rabbit_ssl.erl
index a3cd2b37..e0defa9e 100644
--- a/src/rabbit_ssl.erl
+++ b/src/rabbit_ssl.erl
@@ -211,7 +211,8 @@ format_asn1_value(V) ->
%% subset of ASCII it is also a subset of UTF-8. The others need
%% converting. Fortunately since the Erlang SSL library does the
%% decoding for us (albeit into a weird format, see below), we just
-%% need to handle encoding into UTF-8.
+%% need to handle encoding into UTF-8. Note also that utf8Strings come
+%% back as binary.
%%
%% Note for testing: the default Ubuntu configuration for openssl will
%% only create printableString or teletexString types no matter what
@@ -225,7 +226,7 @@ format_directory_string(printableString, S) -> S;
format_directory_string(teletexString, S) -> utf8_list_from(S);
format_directory_string(bmpString, S) -> utf8_list_from(S);
format_directory_string(universalString, S) -> utf8_list_from(S);
-format_directory_string(utf8String, S) -> S.
+format_directory_string(utf8String, S) -> binary_to_list(S).
utf8_list_from(S) ->
binary_to_list(