Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally serve browser platform over HTTPS #621

Closed
mgatto opened this issue Jul 14, 2023 · 2 comments
Closed

Optionally serve browser platform over HTTPS #621

mgatto opened this issue Jul 14, 2023 · 2 comments

Comments

@mgatto
Copy link

mgatto commented Jul 14, 2023

Feature Request

Motivation Behind Feature

In some development environments, an API is served over SSL via the protocol https. Communicating with that API from a Cordova browser instance on a developer's machine is very efficient work flow. However, modern browsers disallow cross-origin communications between insecure and secured servers. In this case, the secured server is the API, and the insecure server is the current cordova-browser instance served with Node's http module. This is because it is always served without SSL.

Feature Description

The parent issue is in the cordova-browser repo with a full description, partially reproduced in this ticket: apache/cordova-browser#122

Alternatives or Workarounds

Exposing the API over non-secure http is an alternative. In my context, this was rejected strongly for security reasons, especially relating to corporate security accountability programs.

The second is that a developer independently hacks their local cordova installation to enable https. This is suboptimal since upgrading becomes a hassle, requiring careful VCS audits to restore erased, custom code.

@erisu
Copy link
Member

erisu commented Jul 15, 2023

Have you looked into adding platform specific parameters instead of adding to this CLI repo?

Usually platform specific commands are separated by extra double hyphens...

cordova build <platform> <cli-flags> -- <platform-flags>

For example in Android you can see the command below showing Android own defined flags...

cordova run android -- --gradleArg=-PcdvMinSdkVersion=20

If my memory is correct, you will not find gradleArg defined anywhere in this repo or supporting libraries... But is in the platform repo.

I believe in this case, https, flag would fall into the same category.

@mgatto
Copy link
Author

mgatto commented Jul 28, 2023

This is a good idea, and thanks for making me aware of this alternative. I'll close this issue and move my code to cordova-serve instead.

@mgatto mgatto closed this as completed Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants