When using sshexec with the sshconfig option, if your ssh config uses a default identityfile, eg: Host * IdentityFile ~/.ssh/id_rsa Then sshexec will override any explicit host you have set with "null". This bug is most likely caused by line 280 of src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHBase.java in the loadSshConfig method.
could you please verify the simple change https://github.com/apache/ant/commit/f891c4bd8b5acf92f79a49734cffda23cb19959f fixes the problem?