File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -171,25 +171,25 @@ QNetworkReply *QgsNetworkAccessManager::createRequest( QNetworkAccessManager::Op
171
171
172
172
#ifndef QT_NO_OPENSSL
173
173
bool ishttps = pReq->url ().scheme ().toLower () == " https" ;
174
- QgsAuthConfigSslServer servconfig;
175
174
if ( ishttps && !QgsAuthManager::instance ()->isDisabled () )
176
175
{
176
+ QgsDebugMsg ( " Adding trusted CA certs to request" );
177
+ QSslConfiguration sslconfig ( pReq->sslConfiguration () );
178
+ sslconfig.setCaCertificates ( QgsAuthManager::instance ()->getTrustedCaCertsCache () );
179
+
177
180
// check for SSL cert custom config
178
181
QString hostport ( QString ( " %1:%2" )
179
182
.arg ( pReq->url ().host ().trimmed () )
180
183
.arg ( pReq->url ().port () != -1 ? pReq->url ().port () : 443 ) );
181
- servconfig = QgsAuthManager::instance ()->getSslCertCustomConfigByHost ( hostport.trimmed () );
182
-
183
- QgsDebugMsg ( " Adding trusted CA certs to request" );
184
- QSslConfiguration sslconfig ( pReq->sslConfiguration () );
185
- sslconfig.setCaCertificates ( QgsAuthManager::instance ()->getTrustedCaCertsCache () );
184
+ QgsAuthConfigSslServer servconfig = QgsAuthManager::instance ()->getSslCertCustomConfigByHost ( hostport.trimmed () );
186
185
if ( !servconfig.isNull () )
187
186
{
188
187
QgsDebugMsg ( QString ( " Adding SSL custom config to request for %1" ).arg ( hostport ) );
189
188
sslconfig.setProtocol ( servconfig.sslProtocol () );
190
189
sslconfig.setPeerVerifyMode ( servconfig.sslPeerVerifyMode () );
191
190
sslconfig.setPeerVerifyDepth ( servconfig.sslPeerVerifyDepth () );
192
191
}
192
+
193
193
pReq->setSslConfiguration ( sslconfig );
194
194
}
195
195
#endif
You can’t perform that action at this time.
0 commit comments