aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-02-21 15:45:46 +0100
committerIngela Anderton Andin <[email protected]>2013-02-21 15:45:46 +0100
commit4aa03cb5b54435c9007c22db1e346655a36e2948 (patch)
tree87b78d715eb40bf7268ba18979dd86f97b0e7714 /lib/ssl
parent2c0ecc9a21b282b2b08c6594fa2d77dd0bd7aa00 (diff)
parent973e37f099960339c6ba6c16318fb4d318c259e9 (diff)
downloadotp-4aa03cb5b54435c9007c22db1e346655a36e2948.tar.gz
otp-4aa03cb5b54435c9007c22db1e346655a36e2948.tar.bz2
otp-4aa03cb5b54435c9007c22db1e346655a36e2948.zip
Merge branch 'ia/ssl/econnaborted'
* ia/ssl/econnaborted: ssl: Fatal close alert makes more sense than handshake failiure at econnaborted
Diffstat (limited to 'lib/ssl')
-rw-r--r--lib/ssl/src/ssl_connection.erl2
-rw-r--r--lib/ssl/test/ssl_test_lib.erl77
2 files changed, 1 insertions, 78 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 52b765f191..8f4fd88d42 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -987,7 +987,7 @@ handle_info({ErrorTag, Socket, econnaborted}, StateName,
#state{socket = Socket, transport_cb = Transport,
start_or_recv_from = StartFrom, role = Role,
error_tag = ErrorTag} = State) when StateName =/= connection ->
- alert_user(Transport, Socket, StartFrom, ?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE), Role),
+ alert_user(Transport, Socket, StartFrom, ?ALERT_REC(?FATAL, ?CLOSE_NOTIFY), Role),
{stop, normal, State};
handle_info({ErrorTag, Socket, Reason}, StateName, #state{socket = Socket,
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index d58541df52..76b302b1cb 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -203,67 +203,6 @@ close(Pid) ->
ct:print("Pid: ~p down due to:~p ~n", [Pid, Reason])
end.
-
-check_result(Server, {error, SReason} = ServerMsg, Client, {error, closed} = ClientMsg) ->
- receive
- {Server, {error, SReason}} ->
- receive
- {Client, ClientMsg} ->
- ok;
- Unexpected ->
- Reason = {{expected, {Client, ClientMsg}},
- {got, Unexpected}},
- ct:fail(Reason)
- end;
- {Client, ClientMsg} ->
- receive
- {Server, {error, {SReason, _}}} ->
- ok;
- Unexpected ->
- Reason = {{expected, {Server,{error, {SReason, 'term()'}}},
- {got, Unexpected}}},
- ct:fail(Reason)
- end;
- {Port, {data,Debug}} when is_port(Port) ->
- io:format("openssl ~s~n",[Debug]),
- check_result(Server, ServerMsg, Client, ClientMsg);
-
- Unexpected ->
- Reason = {{expected, {Client, ClientMsg}},
- {expected, {Server, {error, {SReason, 'term()'}}}, {got, Unexpected}}},
- ct:fail(Reason)
- end;
-
-check_result(Server, {error, closed} = ServerMsg, Client, {error, CReson} = ClientMsg) ->
- receive
- {Server, ServerMsg} ->
- receive
- {Client, {error, {CReson, _}}} ->
- ok;
- Unexpected ->
- Reason = {{expected, {Client, {error, {CReson, 'term()'}}},
- {got, Unexpected}}},
- ct:fail(Reason)
- end;
- {Client, {error, {CReson, _}}} ->
- receive
- {Server, ServerMsg} ->
- ok;
- Unexpected ->
- Reason = {{expected, {Server, ServerMsg}},
- {got, Unexpected}},
- ct:fail(Reason)
- end;
- {Port, {data,Debug}} when is_port(Port) ->
- io:format("openssl ~s~n",[Debug]),
- check_result(Server, ServerMsg, Client, ClientMsg);
-
- Unexpected ->
- Reason = {{expected, {Client, {error, {CReson, 'term()'}}},
- {expected, {Server, ServerMsg}}, {got, Unexpected}}},
- ct:fail(Reason)
- end;
-
check_result(Server, ServerMsg, Client, ClientMsg) ->
receive
{Server, ServerMsg} ->
@@ -294,22 +233,6 @@ check_result(Server, ServerMsg, Client, ClientMsg) ->
ct:fail(Reason)
end.
-check_result(Pid, {error, Reason} = Err) when Reason == ecertfile;
- Reason == ecacertfile;
- Reason == ekeyfile;
- Reason == edhfile ->
- receive
- {Pid, {error, {Reason, Str}}} when is_list(Str) ->
- ok;
- {Port, {data,Debug}} when is_port(Port) ->
- io:format("openssl ~s~n",[Debug]),
- check_result(Pid, Err);
- Unexpected ->
- Reason = {{expected, {Pid, {error, {Reason, "'appropriate error string'"}}}},
- {got, Unexpected}},
- ct:fail(Reason)
- end;
-
check_result(Pid, Msg) ->
receive
{Pid, Msg} ->