diff --git a/src/libcalamares/network/Tests.cpp b/src/libcalamares/network/Tests.cpp index 2350b79e8..e21a03bab 100644 --- a/src/libcalamares/network/Tests.cpp +++ b/src/libcalamares/network/Tests.cpp @@ -47,8 +47,25 @@ NetworkTests::testPing() using namespace CalamaresUtils::Network; Logger::setupLogLevel( Logger::LOGVERBOSE ); auto& nam = Manager::instance(); + + // On FreeBSD, the SSL handling depends on the presence of root keys + // (from the ca_nss port) which may not be available. So HTTPS requests + // may fail with SSLVerificationError; this breaks the tests even if + // the point is to just check whether ping() works. + // + // So fall back to pinging example.com if the normal ping fails. auto canPing_www_kde_org = nam.synchronousPing( QUrl( "https://www.kde.org" ), RequestOptions( RequestOptions::FollowRedirect ) ); cDebug() << "Ping:" << canPing_www_kde_org; - QVERIFY( canPing_www_kde_org ); + if ( canPing_www_kde_org.status == RequestStatus::HttpError ) + { + cDebug() << Logger::SubEntry << "Some HTTP failure, try example.com instead."; + auto canPing_example_com + = nam.synchronousPing( QUrl( "http://example.com" ), RequestOptions( RequestOptions::FollowRedirect ) ); + QVERIFY( canPing_example_com ); + } + else + { + QVERIFY( canPing_www_kde_org ); + } }