cordova “release” behaves differently to “debug” regarding SSL

前端 未结 3 1884
梦毁少年i
梦毁少年i 2020-12-05 11:49

I have very difficult and totally ungoogleable problem with cordova.

A program, working perfectly being compiled in --debug mode, ceases working after c

3条回答
  •  天涯浪人
    2020-12-05 12:17

    Issue

    Android does not recognise the certificate authority (CA) of that certificate. It is a common issue, specially with older devices, and it affects every device every time a new CA appears.

    Solutions

    A. Configure intermediate certificates.

    Look for a detailed setup for your platform. Here are some examples:

    • Microsoft IIS and Exchange: https://knowledge.digicert.com/solution/SO16219.html

    • Apache on RedHat (and related): https://access.redhat.com/solutions/43575

    You can read more about it in this Q&A at StackExchange's Unix.

    B. Use the trust hierarchy chaining certs.

    Taking advantage of the trust hierarchy feature, you can chain certs.

    You can leverage the effort using a tool like: https://whatsmychaincert.com/

    Or you can do it by yourself, as it is just a concatenation of text files (certs):

    Example steps for Linux / macOS

    1. Concat the authority's certs with your cert. That way you'll send your CA's certificates first to ensure that the device trust your CA before your domain's certificate.

      If you have separated certs, this shell command does the trick:

      $ cat authority1.cert authority2.cert authority3.cert your_domain.cert >> your_domain_bundle.cert
      

      Or if you have a ca-bundle file, that is a concatenation of certificates, just run:

      $ cat authority.ca-bundle your_domain.cert >> your_domain_bundle.cert
      
    2. Add that your_domain_bundle.cert to the server.

    Problem solved for any ssl protocol, https, wss, etc.

提交回复
热议问题