Since we now do not generate a DSA host key file anymore, but keep it in
the list of potential keys so that existing keys still work, it can
happen that the files for DSA (and
Ed25519) are getting loaded but they
do not exist. This results in an error in the log.
So instead check if the file exists and only try to load files that
exist. This prevents from errors (which are none) being spammed in the
log.
*/
package com.gitblit.transport.ssh;
+import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.security.KeyFactory;
{
while (iterator.hasNext()) {
String file = iterator.next();
+ File f = new File(file);
+ if (!f.isFile()) {
+ log.debug("File does not exist, skipping {}", file);
+ continue;
+ }
nextKeyPair = doLoadKey(file);
if (nextKeyPair != null) {
nextKeyPairSet = true;