Build a cache of allowed SSL exceptions and use them on future network requests

The   class  NetworkAccessManager   sub-classes  QNetworkAccessManager
adding  a  message  box  to  ask   the  user  if  SSL  errors  may  be
ignored. Ignored errors  are ignored in future server  replies so that
the user is not asked about he same peer certificate chain repeatedly.
The cache is currently per process only and not persistent.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7361 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville
2016-12-04 14:17:01 +00:00
parent 55811efd64
commit bae3b94fd6
4 changed files with 73 additions and 27 deletions
+7 -5
View File
@@ -26,6 +26,7 @@
#include "revision_utils.hpp"
#include "qt_helpers.hpp"
#include "NetworkAccessManager.hpp"
#include "soundout.h"
#include "soundin.h"
#include "Modulator.hpp"
@@ -157,9 +158,10 @@ namespace
//--------------------------------------------------- MainWindow constructor
MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
MultiSettings * multi_settings, QSharedMemory *shdmem,
unsigned downSampleFactor, QNetworkAccessManager * network_manager,
unsigned downSampleFactor,
QSplashScreen * splash, QWidget *parent) :
QMainWindow(parent),
m_network_manager {this},
m_valid {true},
m_splash {splash},
m_dataDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)},
@@ -254,7 +256,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_onAirFreq0 {0.0},
m_first_error {true},
tx_status_label {"Receiving"},
wsprNet {new WSPRNet {network_manager, this}},
wsprNet {new WSPRNet {&m_network_manager, this}},
m_appDir {QApplication::applicationDirPath ()},
m_palette {"Linrad"},
m_mode {"JT9"},
@@ -336,7 +338,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_config.udp_server_name (), m_config.udp_server_port (),
this}},
psk_Reporter {new PSK_Reporter {m_messageClient, this}},
m_manual {network_manager}
m_manual {&m_network_manager}
{
ui->setupUi(this);
createStatusBar();
@@ -485,10 +487,10 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
ui->actionMediumDecode->setActionGroup(DepthGroup);
ui->actionDeepestDecode->setActionGroup(DepthGroup);
connect (ui->download_samples_action, &QAction::triggered, [this, network_manager] () {
connect (ui->download_samples_action, &QAction::triggered, [this] () {
if (!m_sampleDownloader)
{
m_sampleDownloader.reset (new SampleDownloader {m_settings, &m_config, network_manager, this});
m_sampleDownloader.reset (new SampleDownloader {m_settings, &m_config, &m_network_manager, this});
}
m_sampleDownloader->show ();
});