2023-05-25 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in the podcasting subsystem that could cause SFTP
	operations to fail due to unknown SSH host certificates.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2023-05-25 11:21:31 -04:00
parent 02b0e9d979
commit cb290a2226
5 changed files with 90 additions and 17 deletions

View File

@@ -2,7 +2,7 @@
//
// Delete a file from the audio store via the Rivendell Web Service
//
// (C) Copyright 2010-2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2010-2023 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@@ -127,12 +127,14 @@ RDDelete::ErrorCode RDDelete::runDelete(const QString &username,
//
if((conv_target_url.scheme().toLower()=="sftp")&&
(!id_filename.isEmpty())&&use_id_filename) {
curl_easy_setopt(curl,CURLOPT_SSL_VERIFYHOST,0); // Don't verify hostkey
curl_easy_setopt(curl,CURLOPT_USERNAME,username.toUtf8().constData());
curl_easy_setopt(curl,CURLOPT_SSH_PRIVATE_KEYFILE,
id_filename.toUtf8().constData());
curl_easy_setopt(curl,CURLOPT_KEYPASSWD,password.toUtf8().constData());
}
else {
curl_easy_setopt(curl,CURLOPT_SSL_VERIFYHOST,0); // Don't verify hostkey
curl_easy_setopt(curl,CURLOPT_USERPWD,
(username+":"+password).toUtf8().constData());
}

View File

@@ -46,6 +46,8 @@
#include "rdxport_interface.h"
#include "rdxsltengine.h"
// #define ENABLE_EXTENDED_CURL_LOGGING
int __RDFeed_Debug_Callback(CURL *handle,curl_infotype type,char *data,
size_t size,void *userptr)
{
@@ -942,10 +944,8 @@ bool RDFeed::postPodcast(unsigned cast_id,QString *err_msg)
*err_msg=tr("Unspecified error");
}
delete wr;
delete err_msgs;
return false;
}
delete err_msgs;
return true;
}
@@ -2553,9 +2553,11 @@ QStringList *RDFeed::SetupCurlLogging(CURL *curl) const
{
QStringList *err_msgs=new QStringList();
#ifdef ENABLE_EXTENDED_CURL_LOGGING
curl_easy_setopt(curl,CURLOPT_DEBUGFUNCTION,__RDFeed_Debug_Callback);
curl_easy_setopt(curl,CURLOPT_DEBUGDATA,err_msgs);
curl_easy_setopt(curl,CURLOPT_VERBOSE,1);
#endif // ENABLE_EXTENDED_CURL_LOGGING
return err_msgs;
}
@@ -2564,6 +2566,7 @@ QStringList *RDFeed::SetupCurlLogging(CURL *curl) const
void RDFeed::ProcessCurlLogging(const QString &label,
QStringList *err_msgs) const
{
#ifdef ENABLE_EXTENDED_CURL_LOGGING
if(err_msgs->size()>0) {
rda->syslog(LOG_ERR,"*** %s: extended CURL information begins ***",
label.toUtf8().constData());
@@ -2573,6 +2576,7 @@ void RDFeed::ProcessCurlLogging(const QString &label,
rda->syslog(LOG_ERR,"*** %s: extended CURL information ends ***",
label.toUtf8().constData());
}
#endif // ENABLE_EXTENDED_CURL_LOGGING
delete err_msgs;
}