aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-10-31 10:31:28 +0100
committerHans Nilsson <[email protected]>2017-10-31 10:31:28 +0100
commitd835bd16a1c87a2513df1892e892f94857ed1c86 (patch)
treeced28a64b61783542248d63f21a0e9a8f87a2d15 /lib/ssh/src/ssh.erl
parentb59ae230ed37078125cec0bfeece5c736784931c (diff)
parent4eb26d0aec76f5f9588b330448511172146ac078 (diff)
downloadotp-d835bd16a1c87a2513df1892e892f94857ed1c86.tar.gz
otp-d835bd16a1c87a2513df1892e892f94857ed1c86.tar.bz2
otp-d835bd16a1c87a2513df1892e892f94857ed1c86.zip
Merge branch 'hans/ssh/check_host_user_keys/OTP-14676' into maint
Diffstat (limited to 'lib/ssh/src/ssh.erl')
-rw-r--r--lib/ssh/src/ssh.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index 1a5d48baca..032d87bdad 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -188,6 +188,7 @@ daemon(Port) ->
daemon(Socket, UserOptions) when is_port(Socket) ->
try
#{} = Options = ssh_options:handle_options(server, UserOptions),
+
case valid_socket_to_use(Socket, ?GET_OPT(transport,Options)) of
ok ->
{ok, {IP,Port}} = inet:sockname(Socket),
@@ -461,6 +462,9 @@ open_listen_socket(_Host0, Port0, Options0) ->
%%%----------------------------------------------------------------
finalize_start(Host, Port, Profile, Options0, F) ->
try
+ %% throws error:Error if no usable hostkey is found
+ ssh_connection_handler:available_hkey_algorithms(server, Options0),
+
sshd_sup:start_child(Host, Port, Profile, Options0)
of
{error, {already_started, _}} ->
@@ -470,6 +474,8 @@ finalize_start(Host, Port, Profile, Options0, F) ->
Result = {ok,_} ->
F(Options0, Result)
catch
+ error:{shutdown,Err} ->
+ {error,Err};
exit:{noproc, _} ->
{error, ssh_not_started}
end.