qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.44k stars 2.99k forks source link

QGIS/Qt does not trigger auto-import of Windows root Certificate Authorities #23540

Open qgib opened 8 years ago

qgib commented 8 years ago

Author Name: Luigi Pirelli (@luipir) Original Redmine Issue: 15617

Redmine category:authentication_system Assignee: Larry Shaffer


The following steps demonstrate that QGIS/Qt is not able to trigger auto-importing of trusted root CAs by the Windows OS. Since OpenSSL is used and not the appropriate Win Crypto API calls

To verify, the procedure is:

  1. Open the Windows certificate manager application (certmgr.msc) and remove the "AddTrust External CA Root" certificate if it exists (Note: removal is not detrimental to the Win OS, as this CA is not generally installed with a fresh copy of the OS, and it can readily be re-imported)
  2. Leave the certificate manager open
  3. Open QGIS and add the following plugin repo https://qgis.boundlessgeo.com/plugins.xml?qgis=2.14 (this is for testing only, because the endpoint is known to exihibt the issue; other general, non-plugin-repo SSL endpoints may as well)
  4. Reload plugin repos
  5. Confirm loading the new repo URL generates an SSL Error dialog indicating a missing root CA. Because boundlessgeo.com's SSL certificate is signed by "AddTrust External CA Root" the error should be produced. (Do not ignore or save an override configuration for this error, but abort the error to avoid the connection from being cached)
  6. Open a Web browser based upon native APIs for interacting with the Win keystore, e.g. Chrome , Edge or Internet Explorer (not Firefox, since it has its own internal keystore)
  7. Go to the link https://qgis.boundlessgeo.com/plugins.xml?qgis=2.14 (automatically the Windows OS should install the "AddTrust External CA Root" certificate, in the background, since it is from Comodo, a partner of the Trusted Root Certificate program hosted by Microsoft: http://social.technet.microsoft.com/wiki/contents/articles/31634.microsoft-trusted-root-certificate-program-participants-v-2016-april.aspx )
  8. Refresh the certificate manager list of CAs to verify that "AddTrust External CA Root" has been added automatically (see screen shot attachment for Win 10)
  9. WITHOUT closing QGIS, repeat reloading of the plugin repos
  10. Confirm the same SSL error, and clicking on button "Connection trusted CAs" does not list the "AddTrust External CA Root" cert. Qt is not synched with current status/changes of the Win OS keystore. (NOTE: this is currently expected behavior, as the trusted root CA is not continuously updated by QgsAuthManager, though it should be updated in this circumstance)
  11. Relaunch QGIS
  12. Verify the plugin repo connection now produces no SSL error, as the Win OS CA trusted root list has be synchronized and cached on QGIS startup and the "AddTrust External CA Root" cert is now available.

This shows the following issues that need addressed:

Proposed solutions:


qgib commented 8 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 8 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 8 years ago

Author Name: Jürgen Fischer (@jef-n)


qgib commented 8 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 8 years ago

Author Name: Larry Shaffer (Larry Shaffer)


qgib commented 8 years ago

Author Name: Larry Shaffer (Larry Shaffer)


qgib commented 8 years ago

Author Name: Larry Shaffer (Larry Shaffer)



qgib commented 8 years ago

Author Name: Larry Shaffer (Larry Shaffer)


Regarding the qgis-trusted-cas-cached.png attachment. The left part of the image shows the default trusted root CAs for a fresh install of Windows 10, plus the "AddTrust External CA Root" certificate that was added automatically by the Win OS via its hosted Trusted Root Certificate program.

qgib commented 8 years ago

Author Name: Luigi Pirelli (@luipir)


during dev I found a possible bug reported in #23610

qgib commented 7 years ago

Author Name: Luigi Pirelli (@luipir)


I didn't find any solution to #23610 => the only way to reload ssl CA cache without waiting some minutes for the update is to re-start qgis!

qgib commented 7 years ago

Author Name: Luigi Pirelli (@luipir)


I'll prepare a PR from the following branch:

https://github.com/boundlessgeo/qgis/tree/CAs_import_via_keystore

the fix is applicable only on Windows. No CA problems found on linux and mac.

qgib commented 7 years ago

Author Name: Luigi Pirelli (@luipir)


just waiting to have a UX review before to create the PR

qgib commented 7 years ago

Author Name: Luigi Pirelli (@luipir)


a screencast to show hos the interface works https://youtu.be/pN30XE7r7_k

qgib commented 7 years ago

Author Name: Luigi Pirelli (@luipir)


created two PR

for 2.14: https://github.com/qgis/QGIS/pull/3640 for 2.18: https://github.com/qgis/QGIS/pull/3671

qgib commented 7 years ago

Author Name: Luigi Pirelli (@luipir)


fix only for 2.14 and release-2_18 because probably the issue is not present in qgis3 due the different ssl infrastructure offered by qt5

qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)