-
Notifications
You must be signed in to change notification settings - Fork 655
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
HTTPS support for ionic serve
and Cordova livereload (--ssl)
#3305
Comments
GPS wont work outside of safe env. aka: https. |
Any solutions for this ? I'm having the same issue with |
Will it be for ionic-3 or ionic 4? Im having a project on ionic 3.9.2, a little big that Im afraid of changing |
No plans to add HTTPS to |
Updates? |
Hi any update on this? I'm struggling to get the Geo-location to work on the Ionic Dev App with HTTP so to be able to serve over HTTPS would be great assuming that would fix the issue. |
By using the Angular CLI's `--ssl` option, the webpack server will auto-generate an SSL certificate at runtime. Devs will need to confirm the self-signed certificate in their browsers in order to load the app using `ionic serve --ssl`. Known limitations: * DevApp does not yet support apps on HTTPS (#3748) * The iOS Web View does not support self-signed certificates yet references #3305
ionic serve
and Cordova livereloadionic serve
and Cordova livereload (--ssl)
CLI 4.4.0 is out with an
There are a few gotchas, which I've documented in the original issue description: #3305 (comment) |
So now livereload should work in https with --ssl ? |
@sebast1219 The |
@dwieeb Using |
@dwieeb This is how we do it for angular but ionic appears to ignore these arguments. I specify the correct paths but it always uses a 1 month long cert it generates itself instead of using my 1 year long cert I have in my trusted root. I am using CLI version 5.1.0 |
@GuerrillaCoder Did you notice the separator ( |
@dwieeb oooooh no I didn't. Many thanks for that, my apologies for taking your time. |
Dear guys I still get error trying to use --ssl flag: ionic serve --ssl -- --ssl-cert ..ionic\ssl\cert.pem --ssl-key ..ionic\ssl\key.pem at ChildProcess.spawn (internal/child_process.js:358:11) Could you be so kind to help? Many thanks |
Solution for me for // ...
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"sslKey": "src/certificates/dev.key",
"sslCert": "src/certificates/dev.crt"
},
// ... BUT this won't work for |
@muuvmuuv You can make a feature request for that in this repo: https://github.com/ionic-team/angular-toolkit Basically, the |
is this supposed to work with react, or just angular? is DevApp still a thing, or can #3748 be closed? |
The goal would to get it working with react-scripts too, yes. I closed the other issue, thanks! |
I'm currently unable to get the following boot params to work: |
FYI for React apps, ionic-cli/packages/@ionic/cli/src/lib/project/react/serve.ts Lines 27 to 29 in 0932ff0
|
Fantastic! Thanks for pointing this out; I couldn't find any other reference to this flag |
Unfortunately our online CLI documentation is still specific to Angular. For React, you can use the The |
I have the same problem. How to resolve it. command: ionic cap run android -l --external --ssl -- --ssl-cert .ionic/ssl/cert.pem --ssl-key .ionic/ssl/key.pem |
Same problem but I couldn't resolve it. I tried to generate a ssl certificate and run that command, still a white screen on --ssl. I don't know what I'm doing wrong here. |
I managed to make the --ssl flag work by including another override in:
Also import there:
But this is a nuisance since you need to document this in your project or inform other people that is going to pull it to follow this steps with their own module. |
Thank you, this works for me! |
Using this solution changed platforms array deleting cordova parameter. That means everything is working as if it was in a browser preventing cordova plugins to be loaded. I'm getting:
Is there any solution to actually run ssl on android? |
Any news on this? I need to run the livereload with ssl. And the hack works, but is really annoying. |
I managed to get it runnning for ios with generating mkcerts: https://github.com/FiloSottile/mkcert Run livereload:
And then run a server with a self signed certificate in another terminal
In iOs simulator it's easy to install the certificate (just show path witk |
thx @Schwankenson )
pnpm dev --host="0.0.0.0" --port=8100
npx ionic cap run ios --external --livereload-url="https://192.168.100.3:8100/" |
This might help someone... For Android create a self signed cert for the host address you are using for live reload e.g.
Use this when running ionic cap run e.g. At this point you still get a blank screen when running the emulator because Android doesn't trust this certificate. Copy the live_reload.crt you created to the android raw resource folder Create a network_security_config.xml file with debug-overrides as explained https://developer.android.com/training/articles/security-config?msclkid=44f9be68d04d11eca3865cb4143ff1d6#TrustingDebugCa e.g.
Also if you are working with a local api service for your app it is worth considering using a proxy.conf.json to avoid any similar issues with addressability/trust for your api. |
Thanks @graemeenglish I'm using For people following this approach, you also need to add this to your
|
Ionic 6 here. Still no out-of-the-box solution for running live-reload over https on a physical device... |
This got me 95% of the way: #3305 (comment) To make it work with Vue/Ionic/Capacitor, the command I had to run is:
which in turn runs:
so the Vue server runs in SSL mode. I then had to create a
|
hey, im still having the same problem trying to run ionic --ssl on IOS. Some features need the secure context (https), and i can't manage to bypass the certificate verification on ios. Anyone with the same issue still ? |
Known issues:
HTTPS support in DevApp: HTTPS support in DevApp #3748The text was updated successfully, but these errors were encountered: