You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "mahnunchik (via GitHub)" <gi...@apache.org> on 2024/10/31 09:11:57 UTC

[I] How to access `http` resource from `https` served app? [cordova-android]

mahnunchik opened a new issue, #1742:
URL: https://github.com/apache/cordova-android/issues/1742

   > Yes, I understand that accessing HTTP is insecure. But in exceptional situations, sometimes it's necessary to make such a request.
   
   The question is which is the proper way to access `http` resource from `https` served app?
   
   ### Solution 1
   
   When the app is served from `http`:
   
   ```
   <preference name="scheme" value="http" />
   <preference name="hostname" value="localhost" />
   ```
   
   It is possible to bypass any restriction by adding the following config:
   
   ```
       <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
         <application android:usesCleartextTraffic="true" />
       </edit-config>
   ```
   
   But it seems that this is the least secure method of all.
   
   ### Solution 2
   
   [`cordova-plugin-ionic-webview`](https://github.com/ionic-team/cordova-plugin-ionic-webview) plugin allows to specify:
   
   ```
   // MIXED_CONTENT_ALWAYS_ALLOW
   <preference name="MixedContentMode" value="0" />
   ```
   Android documentation: https://developer.android.com/reference/android/webkit/WebSettings#setMixedContentMode(int)
   
   This allows access to any `http` domains from the application.
   
   ### Questions
   
   1. Maybe `cordova-android` implements the ability to set `setMixedContentMode` setting?
   2. Maybe there is some other way to allow access only to selected http domains? To bypass the limitations of both Android itself and WebView.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] How to access `http` resource from `https` served app? [cordova-android]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1742:
URL: https://github.com/apache/cordova-android/issues/1742#issuecomment-2450254519

   I'm moving this to cordova discussions because it doesn't describe a bug, but it is a valid community question that does come up time to time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] How to access `http` resource from `https` served app? [cordova-android]

Posted by "mahnunchik (via GitHub)" <gi...@apache.org>.
mahnunchik commented on issue #1742:
URL: https://github.com/apache/cordova-android/issues/1742#issuecomment-2449390020

   For some reason, iOS **allows** any HTTP and HTTPS requests from an application served from the `app://` scheme.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] How to access `http` resource from `https` served app? [cordova-android]

Posted by "mahnunchik (via GitHub)" <gi...@apache.org>.
mahnunchik commented on issue #1742:
URL: https://github.com/apache/cordova-android/issues/1742#issuecomment-2449387906

   Related:
   
   * https://github.com/apache/cordova-android/issues/1681
   * https://github.com/apache/cordova-android/issues/1585
   * https://github.com/apache/cordova-android/issues/1354


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org