diff --git a/.circleci/config.yml b/.circleci/config.yml
index 64fb03c875..30eec16e5a 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -105,6 +105,10 @@ commands:
- run:
command: |
source ~/venv/bin/activate
+ # Revert a CircleCI-specific local setting that makes test 1459
+ # return 67 (CURLE_LOGIN_DENIED) instead of the
+ # expected 60 (CURLE_PEER_FAILED_VERIFICATION).
+ echo 'StrictHostKeyChecking yes' >> ~/.ssh/config
make -j3 V=1 test-ci TFLAGS='-j14'
executors:
diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md
index 3897deb9cb..c5c1bcfe90 100644
--- a/docs/tests/FILEFORMAT.md
+++ b/docs/tests/FILEFORMAT.md
@@ -504,7 +504,7 @@ Features testable here are:
- `large-size` (size_t is larger than 32-bit)
- `libssh2`
- `libssh`
-- `oldlibssh` (versions before 0.9.4)
+- `badlibssh` (libssh configuration incompatible with the test suite)
- `libz`
- `local-http`. The HTTP server runs on 127.0.0.1
- `manual`
diff --git a/tests/data/test1459 b/tests/data/test1459
index e4901d74f0..6f3105e8ed 100644
--- a/tests/data/test1459
+++ b/tests/data/test1459
@@ -14,7 +14,7 @@ sftp
sftp
-!oldlibssh
+!badlibssh
SFTP with corrupted known_hosts
@@ -30,7 +30,8 @@ R93Ey5VtBeBblYTRlFXBWJgKFcTKBRJ/O4qBZwbUgt10AHj31i6h8NehfT19tR8wG/YCmj3KtYLHmwdz
# Verify data after the test has been "shot"
-# old libssh installs return the wrong thing
+# badlibssh configurations return the wrong thing: 67 CURLE_LOGIN_DENIED,
+# instead of 60 CURLE_PEER_FAILED_VERIFICATION.
60
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 226573941d..e1608e0aaa 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -632,11 +632,20 @@ sub checksystemfeatures {
}
if($libcurl =~ /libssh\/([0-9.]*)\//i) {
$feature{"libssh"} = 1;
- if($1 =~ /(\d+)\.(\d+).(\d+)/) {
- my $v = $1 * 100 + $2 * 10 + $3;
- if($v < 94) {
- # before 0.9.4
- $feature{"oldlibssh"} = 1;
+ # Detect simple cases of default libssh configuration files ending up
+ # setting `StrictHostKeyChecking no`. include files, quoted values,
+ # '=value' format not implemented.
+ $feature{"badlibssh"} = 0;
+ foreach my $libssh_configfile (('/etc/ssh/ssh_config', $ENV{'HOME'} . '/.ssh/config')) {
+ if(open(my $fd, '<', $libssh_configfile)) {
+ while(my $line = <$fd>) {
+ chomp $line;
+ if($line =~ /^\s*StrictHostKeyChecking\s+(yes|no)\s*$/) {
+ $feature{"badlibssh"} = ($1 eq 'no' ? 1 : 0);
+ last; # Do as openssh and libssh
+ }
+ }
+ close($fd);
}
}
}