Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWebEngineView Adding certificate verification
Qt 6.11 is out! See what's new in the release blog

QWebEngineView Adding certificate verification

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 674 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on last edited by
    #1

    Hi!
    I wont open url in QWebEngineView, but i get error:

    [103262:103307:0603/125326.532299:ERROR:cert_verify_proc_nss.cc(977)] CERT_PKIXVerifyCert for 10.0.102.112 failed err=-8172
    InsecureRequestWarning: Unverified HTTPS request is being made to host '10.0.102.112'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
      warnings.warn(
    

    How I can open this url?

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      The Simple Browser Example has a section describing how to manage ssl errors.

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      2
      • M Offline
        M Offline
        Mikeeeeee
        wrote on last edited by
        #3

        it is work

        import sys
        
        
        from PyQt5.QtCore import QUrl
        from PyQt5.QtWidgets import QApplication
        from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage, QWebEngineCertificateError
        # from PyQt5.QtNetwork import QSslSocket
        
        
        
        class WebEnginePage(QWebEnginePage):
            def __init__(self, parent=None):
                super(QWebEnginePage, self).__init__()
            def certificateError(self, error):
        
                # error.ignoreCertificateError()
                # return True
                return error.isOverridable()
        
        
        def main(args):
            app = QApplication(args)
            webview = QWebEngineView()
            page = WebEnginePage()
            webview.setPage(page)
            webview.load(QUrl("https://www.us.army.mil/"))
            webview.show()
            sys.exit(app.exec_())
        
        
        if __name__ == "__main__":
            main(sys.argv)
        
        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved