diff --git a/src/knownhosts.c b/src/knownhosts.c index 23902a5f..546619aa 100644 --- a/src/knownhosts.c +++ b/src/knownhosts.c @@ -306,7 +306,8 @@ struct ssh_list *ssh_known_hosts_get_algorithms(ssh_session session) int list_error = 0; int rc; - if (session->opts.knownhosts == NULL) { + if (session->opts.knownhosts == NULL || + session->opts.global_knownhosts == NULL) { if (ssh_options_apply(session) < 0) { ssh_set_error(session, SSH_REQUEST_DENIED,