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. [SOLVED] QNetworkAccessManager crash related to SSL

[SOLVED] QNetworkAccessManager crash related to SSL

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 4.1k Views 1 Watching
  • 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.
  • F Offline
    F Offline
    frano_ri
    wrote on last edited by
    #1

    My Qt Windows desktop application crashes on first QNetworkAccessManager->get call. I get following error in the log.

    @Auto configuration failed
    16100:error:02001015:system library:fopen:Is a directory:.\crypto\bio\bss_file.c:122:fopen('d:/openssl/ssl/openssl.cnf','rb')
    16100:error:2006D002:BIO routines:BIO_new_file:system lib:.\crypto\bio\bss_file.c:127:
    16100:error:0E078002:configuration file routines:DEF_LOAD:system lib:.\crypto\conf\conf_def.c:199@

    It is something related to OpenSSL configuration, but I actually don't use (and don't need) SSL in my application. I know that OpenSSL library is loaded together with QNetworkAccessManager, but is there any way to disable it?

    I can fix this problem by reinstalling openssl libraries like it is stated here ( http://stackoverflow.com/questions/13526389/qt-webkit-widget-error ), but this is not a good solution since I cannot force my customers to reinstall openssl on their systems because of my application. So I am looking for a better solution. I already tried adding DEFINES += QT_NO_SSL into my project file but with no luck. Interesting here is that this is only happening after I deploy my application, it works smoothly from Qt Creator.

    Important thing here is that I can manually manipulate crashing (on deploy systems) by modifying OPENSSL_CONF environment variable. If it does not exist or if it is set correctly, app won't crash, otherwise (env. variable is set to incorrect folder) app crashes.

    Any ideas?

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      [quote author="frano_ri" date="1421410242"]
      It is something related to OpenSSL configuration, but I actually don't use (and don't need) SSL in my application. I know that OpenSSL library is loaded together with QNetworkAccessManager, but is there any way to disable it?
      [/quote]

      You need to recompile Qt without OpenSSL support then. The official Qt deliveries are built with OpenSSL support enabled by default.

      [quote author="frano_ri" date="1421410242"]
      I already tried adding DEFINES += QT_NO_SSL into my project file but with no luck. Interesting here is that this is only happening after I deploy my application, it works smoothly from Qt Creator.
      [/quote]

      This won't work, since in you project file you only set the DEFINES for you project, but it won't affect how Qt was built (see first comment).

      [quote author="frano_ri" date="1421410242"]--
      Important thing here is that I can manually manipulate crashing (on deploy systems) by modifying OPENSSL_CONF environment variable. If it does not exist or if it is set correctly, app won't crash, otherwise (env. variable is set to incorrect folder) app crashes.
      [/quote]

      Nothing you can do to a misconfigurated system.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • F Offline
        F Offline
        frano_ri
        wrote on last edited by
        #3

        Ok, thanks a lot! But, how should I recompile Qt without OpenSSL?
        And why it does not crash when I run it directly from Qt Creator?

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          [quote author="frano_ri" date="1421416101"]Ok, thanks a lot! But, how should I recompile Qt without OpenSSL?
          [/quote]
          see "this":http://qt-project.org/wiki/Building_Qt_5_from_Git and "this":http://doc.qt.io/qt-5/ssl.html#enabling-and-disabling-ssl-support

          Make sure you call Qt's configure with the "-no-openssl" option

          [quote author="frano_ri" date="1421416101"]
          And why it does not crash when I run it directly from Qt Creator?[/quote]

          On the same machine?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • F Offline
            F Offline
            frano_ri
            wrote on last edited by
            #5

            [quote author="raven-worx" date="1421417877"][quote author="frano_ri" date="1421416101"]Ok, thanks a lot! But, how should I recompile Qt without OpenSSL?
            [/quote]
            see "this":http://qt-project.org/wiki/Building_Qt_5_from_Git and "this":http://doc.qt.io/qt-5/ssl.html#enabling-and-disabling-ssl-support

            Make sure you call Qt's configure with the "-no-openssl" option
            [/quote]
            Thanks, I'll try that.

            [quote author="raven-worx" date="1421417877"]
            [quote author="frano_ri" date="1421416101"]
            And why it does not crash when I run it directly from Qt Creator?[/quote]

            On the same machine?
            [/quote]

            Yes, on the same machine, that's strange. Is it possible that Qt is correctly compiled then, but I miss something on deployment?

            1 Reply Last reply
            0
            • raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              recompiling without OpenSSL support is the safest way since you do not need it anyway.

              QtCreator is also capable of using it's own environmental variables when starting the application out of it. You can check it in QtCreator's project settings under "Build Environment" for the kit you use to build (in the "Project" section in the toolbar on the left side)

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • F Offline
                F Offline
                frano_ri
                wrote on last edited by
                #7

                I tried setting environment variables in "Build Environment" settings, but it only applies to application when running from Qt Creator.
                I have manage to resolve my issue by using qunsetenv("OPENSSL_CONF") at the application start.

                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