QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
qgsauthsslconfigwidget.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsauthsslconfigwidget.cpp
3 ---------------------
4 begin : May 17, 2015
5 copyright : (C) 2015 by Boundless Spatial, Inc. USA
6 author : Larry Shaffer
7 email : lshaffer at boundlessgeo dot com
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
18#include "moc_qgsauthsslconfigwidget.cpp"
20
21#include <QDialogButtonBox>
22#include <QPushButton>
23#include <QSpinBox>
24#include <QUrl>
25
26#include "qgsauthguiutils.h"
27#include "qgsauthmanager.h"
28#include "qgslogger.h"
29#include "qgsapplication.h"
30
31
32static void setItemBold_( QTreeWidgetItem *item )
33{
34 item->setFirstColumnSpanned( true );
35 QFont secf( item->font( 0 ) );
36 secf.setBold( true );
37 item->setFont( 0, secf );
38}
39
40static const QString configFoundText_() { return QObject::tr( "Configuration loaded from database" ); }
41static const QString configNotFoundText_() { return QObject::tr( "Configuration not found in database" ); }
42
44 const QSslCertificate &cert,
45 const QString &hostport,
46 const QList<QSslCertificate> &connectionCAs )
47 : QWidget( parent )
48 , mCert( nullptr )
49 , mConnectionCAs( connectionCAs )
50{
51 if ( QgsApplication::authManager()->isDisabled() )
52 {
53 mDisabled = true;
54 mAuthNotifyLayout = new QVBoxLayout;
55 this->setLayout( mAuthNotifyLayout );
56 mAuthNotify = new QLabel( QgsApplication::authManager()->disabledMessage(), this );
57 mAuthNotifyLayout->addWidget( mAuthNotify );
58 }
59 else
60 {
61 setupUi( this );
62 connect( btnCertInfo, &QToolButton::clicked, this, &QgsAuthSslConfigWidget::btnCertInfo_clicked );
63
64 connect( grpbxSslConfig, &QGroupBox::toggled, this, &QgsAuthSslConfigWidget::configEnabledChanged );
67
68 setUpSslConfigTree();
69
70 lblLoadedConfig->setVisible( false );
71 lblLoadedConfig->clear();
72
73 connect( leHost, &QLineEdit::textChanged,
75
76 if ( !cert.isNull() )
77 {
78 setSslCertificate( cert, hostport );
79 }
80 }
81}
82
84{
85 if ( mDisabled )
86 {
87 return nullptr;
88 }
89 return grpbxCert;
90}
91
93{
94 if ( mDisabled )
95 {
96 return nullptr;
97 }
98 return grpbxSslConfig;
99}
100
101// private
102QTreeWidgetItem *QgsAuthSslConfigWidget::addRootItem( const QString &label )
103{
104 QTreeWidgetItem *item = new QTreeWidgetItem(
105 QStringList() << label,
106 static_cast<int>( ConfigParent ) );
107 setItemBold_( item );
108 item->setTextAlignment( 0, Qt::AlignVCenter );
109 item->setFlags( item->flags() & ~Qt::ItemIsSelectable );
110 treeSslConfig->insertTopLevelItem( treeSslConfig->topLevelItemCount(), item );
111
112 return item;
113}
114
115void QgsAuthSslConfigWidget::setUpSslConfigTree()
116{
117 treeSslConfig->setColumnCount( 1 );
118
119 // add config field names
120 mProtocolItem = addRootItem( tr( "Protocol" ) );
121 mProtocolCmbBx = new QComboBox( treeSslConfig );
122 mProtocolCmbBx->addItem( QgsAuthCertUtils::getSslProtocolName( QSsl::SecureProtocols ),
123 static_cast<int>( QSsl::SecureProtocols ) );
124 mProtocolCmbBx->addItem( QgsAuthCertUtils::getSslProtocolName( QSsl::TlsV1_0 ),
125 static_cast<int>( QSsl::TlsV1_0 ) );
126 mProtocolCmbBx->setMaximumWidth( 300 );
127 mProtocolCmbBx->setCurrentIndex( 0 );
128 QTreeWidgetItem *protocolitem = new QTreeWidgetItem(
129 mProtocolItem,
130 QStringList() << QString(),
131 static_cast<int>( ConfigItem ) );
132 protocolitem->setFlags( protocolitem->flags() & ~Qt::ItemIsSelectable );
133 treeSslConfig->setItemWidget( protocolitem, 0, mProtocolCmbBx );
134 mProtocolItem->setExpanded( true );
135
136 mVerifyModeItem = addRootItem( tr( "Peer verification" ) );
137 mVerifyPeerCmbBx = new QComboBox( treeSslConfig );
138 mVerifyPeerCmbBx->addItem( tr( "Verify Peer Certs" ),
139 static_cast<int>( QSslSocket::VerifyPeer ) );
140 mVerifyPeerCmbBx->addItem( tr( "Do Not Verify Peer Certs" ),
141 static_cast<int>( QSslSocket::VerifyNone ) );
142 mVerifyPeerCmbBx->setMaximumWidth( 300 );
143 mVerifyPeerCmbBx->setCurrentIndex( 0 );
144 QTreeWidgetItem *peerverifycmbxitem = new QTreeWidgetItem(
145 mVerifyModeItem,
146 QStringList() << QString(),
147 static_cast<int>( ConfigItem ) );
148 peerverifycmbxitem->setFlags( peerverifycmbxitem->flags() & ~Qt::ItemIsSelectable );
149 treeSslConfig->setItemWidget( peerverifycmbxitem, 0, mVerifyPeerCmbBx );
150 mVerifyModeItem->setExpanded( true );
151
152 mVerifyDepthItem = addRootItem( tr( "Peer verification depth (0 = complete cert chain)" ) );
153 mVerifyDepthSpnBx = new QSpinBox( treeSslConfig );
154 mVerifyDepthSpnBx->setMinimum( 0 );
155 mVerifyDepthSpnBx->setMaximum( 10 );
156 mVerifyDepthSpnBx->setMaximumWidth( 200 );
157 mVerifyDepthSpnBx->setAlignment( Qt::AlignHCenter );
158 QTreeWidgetItem *peerverifyspnbxitem = new QTreeWidgetItem(
159 mVerifyDepthItem,
160 QStringList() << QString(),
161 static_cast<int>( ConfigItem ) );
162 peerverifyspnbxitem->setFlags( peerverifyspnbxitem->flags() & ~Qt::ItemIsSelectable );
163 treeSslConfig->setItemWidget( peerverifyspnbxitem, 0, mVerifyDepthSpnBx );
164 mVerifyDepthItem->setExpanded( true );
165
166 mIgnoreErrorsItem = addRootItem( tr( "Ignore errors" ) );
167
168 const QList<QPair<QSslError::SslError, QString> > errenums = QgsAuthCertUtils::sslErrorEnumStrings();
169 for ( int i = 0; i < errenums.size(); i++ )
170 {
171 QTreeWidgetItem *item = new QTreeWidgetItem(
172 mIgnoreErrorsItem,
173 QStringList() << errenums.at( i ).second,
174 static_cast<int>( ConfigItem ) );
175 item->setCheckState( 0, Qt::Unchecked );
176 item->setTextAlignment( 0, Qt::AlignVCenter );
177 item->setFlags( item->flags() & ~Qt::ItemIsSelectable );
178 item->setData( 0, Qt::UserRole, errenums.at( i ).first );
179 }
180 mIgnoreErrorsItem->setExpanded( true );
181}
182
184{
186 if ( mDisabled )
187 {
188 return config;
189 }
190 config.setSslCertificate( mCert );
191 config.setSslHostPort( leHost->text() );
192 config.setSslProtocol( sslProtocol() );
196 return config;
197}
198
200{
201 if ( mDisabled )
202 {
203 return QSslCertificate();
204 }
205 return mCert;
206}
207
209{
210 if ( mDisabled )
211 {
212 return QString();
213 }
214 return leHost->text();
215}
216
218{
219 if ( mDisabled )
220 {
221 return;
222 }
223 if ( grpbxSslConfig->isCheckable() )
224 {
225 grpbxSslConfig->setChecked( enable );
226 }
227}
228
229void QgsAuthSslConfigWidget::setSslCertificate( const QSslCertificate &cert, const QString &hostport )
230{
231 if ( mDisabled )
232 {
233 return;
234 }
235 if ( cert.isNull() )
236 {
237 return;
238 }
239 mCert = cert;
240
241 if ( !hostport.isEmpty() )
242 {
243 setSslHost( hostport );
244 }
245
246 const QString sha( QgsAuthCertUtils::shaHexForCert( cert ) );
247 const QgsAuthConfigSslServer config(
248 QgsApplication::authManager()->sslCertCustomConfig( sha, hostport.isEmpty() ? sslHost() : hostport ) );
249
250 emit certFoundInAuthDatabase( !config.isNull() );
251
252 lblLoadedConfig->setVisible( true );
253 if ( !config.isNull() )
254 {
255 loadSslCustomConfig( config );
256 leCommonName->setStyleSheet( QgsAuthGuiUtils::greenTextStyleSheet() );
257 }
258 else
259 {
260 lblLoadedConfig->setText( configNotFoundText_() );
261 leCommonName->setText( QgsAuthCertUtils::resolvedCertName( mCert ) );
262 leCommonName->setStyleSheet( QgsAuthGuiUtils::orangeTextStyleSheet() );
263 }
264 validateHostPortText( leHost->text() );
265}
266
268{
269 if ( mDisabled )
270 {
271 return;
272 }
274 if ( config.isNull() )
275 {
276 QgsDebugError( QStringLiteral( "Passed-in SSL custom config is null" ) );
277 return;
278 }
279
280 const QSslCertificate cert( config.sslCertificate() );
281 if ( cert.isNull() )
282 {
283 QgsDebugError( QStringLiteral( "SSL custom config's cert is null" ) );
284 return;
285 }
286
288 mCert = cert;
289 leCommonName->setText( QgsAuthCertUtils::resolvedCertName( cert ) );
290 leHost->setText( config.sslHostPort() );
292 setSslProtocol( config.sslProtocol() );
294
295 lblLoadedConfig->setVisible( true );
296 lblLoadedConfig->setText( configFoundText_() );
297}
298
300{
301 if ( mDisabled )
302 {
303 return;
304 }
305 if ( !QgsApplication::authManager()->storeSslCertCustomConfig( sslCustomConfig() ) )
306 {
307 QgsDebugError( QStringLiteral( "SSL custom config FAILED to store in authentication database" ) );
308 }
309}
310
312{
313 if ( mDisabled )
314 {
315 return;
316 }
317 mCert.clear();
318 mConnectionCAs.clear();
319 leCommonName->clear();
320 leCommonName->setStyleSheet( QString() );
321 leHost->clear();
322
323 lblLoadedConfig->setVisible( false );
324 lblLoadedConfig->clear();
328 enableSslCustomOptions( false );
329}
330
332{
333 if ( mDisabled )
334 {
335 return QSsl::UnknownProtocol;
336 }
337 return ( QSsl::SslProtocol )mProtocolCmbBx->currentData().toInt();
338}
339
340void QgsAuthSslConfigWidget::setSslProtocol( QSsl::SslProtocol protocol )
341{
342 if ( mDisabled )
343 {
344 return;
345 }
346 const int indx( mProtocolCmbBx->findData( static_cast<int>( protocol ) ) );
347 mProtocolCmbBx->setCurrentIndex( indx );
348}
349
351{
352 if ( mDisabled )
353 {
354 return;
355 }
356 mProtocolCmbBx->setCurrentIndex( 0 );
357}
358
359void QgsAuthSslConfigWidget::appendSslIgnoreErrors( const QList<QSslError> &errors )
360{
361 if ( mDisabled )
362 {
363 return;
364 }
366
367 QList<QSslError::SslError> errenums;
368 const auto constErrors = errors;
369 for ( const QSslError &err : constErrors )
370 {
371 errenums << err.error();
372 }
373
374 for ( int i = 0; i < mIgnoreErrorsItem->childCount(); i++ )
375 {
376 QTreeWidgetItem *item( mIgnoreErrorsItem->child( i ) );
377 if ( errenums.contains( ( QSslError::SslError )item->data( 0, Qt::UserRole ).toInt() ) )
378 {
379 item->setCheckState( 0, Qt::Checked );
380 }
381 }
382}
383
384void QgsAuthSslConfigWidget::setSslIgnoreErrorEnums( const QList<QSslError::SslError> &errorenums )
385{
386 if ( mDisabled )
387 {
388 return;
389 }
390 QList<QSslError> errors;
391 const auto constErrorenums = errorenums;
392 for ( const QSslError::SslError errorenum : constErrorenums )
393 {
394 errors << QSslError( errorenum );
395 }
396 setSslIgnoreErrors( errors );
397}
398
399void QgsAuthSslConfigWidget::setSslIgnoreErrors( const QList<QSslError> &errors )
400{
401 if ( mDisabled )
402 {
403 return;
404 }
405 if ( errors.isEmpty() )
406 {
407 return;
408 }
409
411
412 QList<QSslError::SslError> errenums;
413 const auto constErrors = errors;
414 for ( const QSslError &err : constErrors )
415 {
416 errenums << err.error();
417 }
418
419 for ( int i = 0; i < mIgnoreErrorsItem->childCount(); i++ )
420 {
421 QTreeWidgetItem *item( mIgnoreErrorsItem->child( i ) );
422 const bool enable( errenums.contains( ( QSslError::SslError )item->data( 0, Qt::UserRole ).toInt() ) );
423 item->setCheckState( 0, enable ? Qt::Checked : Qt::Unchecked );
424 }
425}
426
428{
429 if ( mDisabled )
430 {
431 return;
432 }
433 for ( int i = 0; i < mIgnoreErrorsItem->childCount(); i++ )
434 {
435 mIgnoreErrorsItem->child( i )->setCheckState( 0, Qt::Unchecked );
436 }
437}
438
439const QList<QSslError::SslError> QgsAuthSslConfigWidget::sslIgnoreErrorEnums()
440{
441 QList<QSslError::SslError> errs;
442 if ( mDisabled )
443 {
444 return errs;
445 }
446 for ( int i = 0; i < mIgnoreErrorsItem->childCount(); i++ )
447 {
448 QTreeWidgetItem *item( mIgnoreErrorsItem->child( i ) );
449 if ( item->checkState( 0 ) == Qt::Checked )
450 {
451 errs.append( ( QSslError::SslError )item->data( 0, Qt::UserRole ).toInt() );
452 }
453 }
454 return errs;
455}
456
458{
459 if ( mDisabled )
460 {
461 return QSslSocket::AutoVerifyPeer;
462 }
463 return ( QSslSocket::PeerVerifyMode )mVerifyPeerCmbBx->currentData().toInt();
464}
465
467{
468 if ( mDisabled )
469 {
470 return 0;
471 }
472 return mVerifyDepthSpnBx->value();
473}
474
475void QgsAuthSslConfigWidget::setSslPeerVerify( QSslSocket::PeerVerifyMode mode, int modedepth )
476{
477 if ( mDisabled )
478 {
479 return;
480 }
482
483 const int indx( mVerifyPeerCmbBx->findData( static_cast<int>( mode ) ) );
484 mVerifyPeerCmbBx->setCurrentIndex( indx );
485
486 mVerifyDepthSpnBx->setValue( modedepth );
487}
488
490{
491 if ( mDisabled )
492 {
493 return;
494 }
495 mVerifyPeerCmbBx->setCurrentIndex( 0 );
496 mVerifyDepthSpnBx->setValue( 0 );
497}
498
500{
501 if ( mDisabled )
502 {
503 return false;
504 }
505 const bool cansave = ( isEnabled()
506 && ( grpbxSslConfig->isCheckable() ? grpbxSslConfig->isChecked() : true )
507 && validateHostPort( leHost->text() ) );
508 if ( mCanSave != cansave )
509 {
510 mCanSave = cansave;
511 emit readyToSaveChanged( cansave );
512 }
513 return cansave;
514}
515
516void QgsAuthSslConfigWidget::setSslHost( const QString &host )
517{
518 if ( mDisabled )
519 {
520 return;
521 }
522 leHost->setText( host );
523}
524
525bool QgsAuthSslConfigWidget::validateHostPort( const QString &txt )
526{
527 const QString hostport( txt );
528 if ( hostport.isEmpty() )
529 {
530 return false;
531 }
532
533 // TODO: add QRegex checks against valid IP and domain.tld input
534 // i.e., currently accepts unlikely (though maybe valid) host:port combo, like 'a:1'
535 const QString urlbase( QStringLiteral( "https://%1" ).arg( hostport ) );
536 const QUrl url( urlbase );
537 return ( !url.host().isEmpty() && QString::number( url.port() ).size() > 0
538 && QStringLiteral( "https://%1:%2" ).arg( url.host() ).arg( url.port() ) == urlbase );
539}
540
542{
543 if ( mDisabled )
544 {
545 return;
546 }
547 const bool valid = validateHostPort( txt );
548 leHost->setStyleSheet( valid ? QgsAuthGuiUtils::greenTextStyleSheet()
550 emit hostPortValidityChanged( valid );
551}
552
554{
555 if ( mDisabled )
556 {
557 return;
558 }
559 grpbxSslConfig->setCheckable( checkable );
560 if ( !checkable )
561 {
562 grpbxSslConfig->setEnabled( true );
563 }
564}
565
566void QgsAuthSslConfigWidget::btnCertInfo_clicked()
567{
568 if ( mCert.isNull() )
569 {
570 return;
571 }
572
573 QgsAuthCertInfoDialog *dlg = new QgsAuthCertInfoDialog( mCert, false, this, mConnectionCAs );
574 dlg->setWindowModality( Qt::WindowModal );
575 dlg->resize( 675, 500 );
576 dlg->exec();
577 dlg->deleteLater();
578}
579
580
582
583QgsAuthSslConfigDialog::QgsAuthSslConfigDialog( QWidget *parent, const QSslCertificate &cert, const QString &hostport )
584 : QDialog( parent )
585
586{
587 setWindowTitle( tr( "Custom Certificate Configuration" ) );
588 QVBoxLayout *layout = new QVBoxLayout( this );
589 layout->setContentsMargins( 6, 6, 6, 6 );
590
591 mSslConfigWdgt = new QgsAuthSslConfigWidget( this, cert, hostport );
592 connect( mSslConfigWdgt, &QgsAuthSslConfigWidget::readyToSaveChanged,
593 this, &QgsAuthSslConfigDialog::checkCanSave );
594 layout->addWidget( mSslConfigWdgt );
595
596 QDialogButtonBox *buttonBox = new QDialogButtonBox(
597 QDialogButtonBox::Close | QDialogButtonBox::Save, Qt::Horizontal, this );
598
599 buttonBox->button( QDialogButtonBox::Close )->setDefault( true );
600 mSaveButton = buttonBox->button( QDialogButtonBox::Save );
601 connect( buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close );
602 connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsAuthSslConfigDialog::accept );
603 layout->addWidget( buttonBox );
604
605 setLayout( layout );
606 mSaveButton->setEnabled( mSslConfigWdgt->readyToSave() );
607}
608
610{
611 mSslConfigWdgt->saveSslCertConfig();
612 QDialog::accept();
613}
614
615void QgsAuthSslConfigDialog::checkCanSave( bool cansave )
616{
617 mSaveButton->setEnabled( cansave );
618}
static QgsAuthManager * authManager()
Returns the application's authentication manager instance.
Dialog wrapper for widget displaying detailed info on a certificate and its hierarchical trust chain.
static QString resolvedCertName(const QSslCertificate &cert, bool issuer=false)
Gets the general name via RFC 5280 resolution.
static QString shaHexForCert(const QSslCertificate &cert, bool formatted=false)
Gets the sha1 hash for certificate.
static QString getSslProtocolName(QSsl::SslProtocol protocol)
SSL Protocol name strings per enum.
static QList< QPair< QSslError::SslError, QString > > sslErrorEnumStrings()
Gets short strings describing SSL errors.
Configuration container for SSL server connection exceptions or overrides.
void setSslProtocol(QSsl::SslProtocol protocol)
Sets SSL server protocol to use in connections.
void setSslCertificate(const QSslCertificate &cert)
Sets server certificate object.
void setSslHostPort(const QString &hostport)
Sets server host:port string.
QSsl::SslProtocol sslProtocol() const
SSL server protocol to use in connections.
void setSslPeerVerifyMode(QSslSocket::PeerVerifyMode mode)
Sets SSL client's peer verify mode to use in connections.
void setSslPeerVerifyDepth(int depth)
Set number or SSL client's peer to verify in connections.
int sslPeerVerifyDepth() const
Number or SSL client's peer to verify in connections.
bool isNull() const
Whether configuration is null (missing components)
void setSslIgnoredErrorEnums(const QList< QSslError::SslError > &errors)
Sets SSL server errors (as enum list) to ignore in connections.
const QList< QSslError::SslError > sslIgnoredErrorEnums() const
SSL server errors (as enum list) to ignore in connections.
QSslSocket::PeerVerifyMode sslPeerVerifyMode() const
SSL client's peer verify mode to use in connections.
const QSslCertificate sslCertificate() const
Server certificate object.
const QString sslHostPort() const
Server host:port string.
static QString greenTextStyleSheet(const QString &selector="*")
Green text stylesheet representing valid, trusted, etc. certificate.
static QString redTextStyleSheet(const QString &selector="*")
Red text stylesheet representing invalid, untrusted, etc. certificate.
static QString orangeTextStyleSheet(const QString &selector="*")
Orange text stylesheet representing loaded component, but not stored in database.
QgsAuthSslConfigDialog(QWidget *parent=nullptr, const QSslCertificate &cert=QSslCertificate(), const QString &hostport=QString())
Construct wrapper dialog for the SSL config widget.
Widget for editing an SSL server configuration.
QgsAuthSslConfigWidget(QWidget *parent=nullptr, const QSslCertificate &cert=QSslCertificate(), const QString &hostport=QString(), const QList< QSslCertificate > &connectionCAs=QList< QSslCertificate >())
Construct a widget for editing an SSL server certificate configuration.
const QSslCertificate sslCertificate()
Gets the SSL server certificate.
void validateHostPortText(const QString &txt)
Parse string for host:port.
void setSslPeerVerify(QSslSocket::PeerVerifyMode mode, int modedepth)
Sets the client's peer verify mode for connections.
QSslSocket::PeerVerifyMode sslPeerVerifyMode()
Gets the client's peer verify mode for connections.
QSsl::SslProtocol sslProtocol()
Gets the SSL protocol used for connections.
QGroupBox * sslConfigGroupBox()
Access to the SSL configuration's group box widget.
const QString sslHost()
Gets the host:port to associate with the server certificate.
void resetSslCertConfig()
Clear the current SSL server configuration and disabled it.
void setSslCertificate(const QSslCertificate &cert, const QString &hostport=QString())
Sets SSl certificate and any associated host:port.
void saveSslCertConfig()
Save the current SSL server configuration to the authentication database.
void certFoundInAuthDatabase(bool found)
Emitted when an certificate of same SHA hash is found in authentication database.
void resetSslProtocol()
Reset the SSL protocol to use in connections to the default.
void setSslHost(const QString &host)
Sets the host of the server.
void appendSslIgnoreErrors(const QList< QSslError > &errors)
Add to SSL errors to ignore for the connection.
void hostPortValidityChanged(bool valid)
Emitted when the validity of the host:port changes.
void setSslIgnoreErrorEnums(const QList< QSslError::SslError > &errorenums)
Sets the SSL errors (as enums) to ignore for the connection.
void readyToSaveChanged(bool cansave)
Emitted when the configuration can be saved changes.
void resetSslIgnoreErrors()
Clear the SSL errors to ignore for the connection.
void configEnabledChanged(bool enabled)
Emitted when the enabled state of the configuration changes.
void setSslIgnoreErrors(const QList< QSslError > &errors)
Sets the SSL errors to ignore for the connection.
int sslPeerVerifyDepth()
Gets the client's peer verify depth for connections.
void loadSslCustomConfig(const QgsAuthConfigSslServer &config=QgsAuthConfigSslServer())
Load an existing SSL server configuration.
const QList< QSslError::SslError > sslIgnoreErrorEnums()
Gets list of the SSL errors (as enums) to be ignored for connections.
bool readyToSave()
Verify if the configuration if ready to save.
void setSslProtocol(QSsl::SslProtocol protocol)
Sets the SSL protocol to use in connections.
QGroupBox * certificateGroupBox()
Access to the certificate's group box widget.
void enableSslCustomOptions(bool enable)
Enable or disable the custom options widget.
void resetSslPeerVerify()
Reset the client's peer verify mode for connections to default.
void setConfigCheckable(bool checkable)
Sets whether the config group box is checkable.
const QgsAuthConfigSslServer sslCustomConfig()
Gets the SSL configuration.
#define QgsDebugError(str)
Definition qgslogger.h:38