You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTPS support for ionic serve and Cordova livereload (--ssl) #3305
@redplane That command (and the Cordova browser platform) isn't fully supported. See #3043. The solution is forthcoming and this issue will be updated when it arrives.
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.
Unfortunately our online CLI documentation is still specific to Angular. For React, you can use the --help flag in your terminal: ionic serve --help.
The --https flag for React is a bit different than what this issue was originally trying to accomplish. It uses a webpack plugin that automatically generates an SSL certificate at runtime, but when I last tried to use it there were trust issues.
I'm currently unable to get the following boot params to work: ionic capacitor run android -l --ssl --external - it launches the app correctly but on the emulator I just get a white screen with no url in the webview. I believe it's linked to this issue because it only arises when I add the --ssl flag to the command. This is on Windows 10, using Ionic 5 and running on an emulated Pixel C API 29.
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
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:
node_modules/@capacitor/android/capacitor/src/main/java/com/getcapacitor/BridgeWebViewClient.java
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.
I managed to make the --ssl flag work by including another override in:
node_modules/@capacitor/android/capacitor/src/main/java/com/getcapacitor/BridgeWebViewClient.java
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!
But it is of course not a good solution to make changes in a node module. Would be great to have a fix in a clean way.
I managed to make the --ssl flag work by including another override in:
node_modules/@capacitor/android/capacitor/src/main/java/com/getcapacitor/BridgeWebViewClient.java
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.
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:
Msg: Native: tried calling BluetoothLE.isScanning, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
Is there any solution to actually run ssl on android?
ionic cap run ios --external --livereload-url=capacitor://mytestdomain.test:8100
And then run a server with a self signed certificate in another terminal
ng run app:serve --host=0.0.0.0 --port=8100 --ssl --public-host=rg-eat.test --ssl-cert=/host_system_mkcert_folder/${RG_MKCERT_CERT_NAME} --ssl-key=/host_system_mkcert_folder/${RG_MKCERT_KEY_NAME}
In iOs simulator it's easy to install the certificate (just show path witk mkcert -CAROOT) and drag it to the simulator.
In Android it can be installed and works in browser, but it is not compiled in Android Studio without the hack from @JesusSPC
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.
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.
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 ?
Activity
bleuscyther commentedon Jul 17, 2018
GPS wont work outside of safe env. aka: https.
refactor(ssl): scope generate command to project
redplane commentedon Aug 27, 2018
Any solutions for this ? I'm having the same issue with
ionic cordova run browser --livereloadimhoffd commentedon Aug 27, 2018
@redplane That command (and the Cordova browser platform) isn't fully supported. See #3043. The solution is forthcoming and this issue will be updated when it arrives.
redplane commentedon Aug 28, 2018
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
imhoffd commentedon Aug 28, 2018
No plans to add HTTPS to
@ionic/app-scriptsfor Ionic 3.kurtommy commentedon Oct 29, 2018
Updates?
CJTalbot87 commentedon Nov 13, 2018
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.
feat(serve): forward `--ssl` to Angular CLI
feat(serve): support `--ssl` for dev-server
20 remaining items
imhoffd commentedon Jul 2, 2020
Unfortunately our online CLI documentation is still specific to Angular. For React, you can use the
--helpflag in your terminal:ionic serve --help.The
--httpsflag for React is a bit different than what this issue was originally trying to accomplish. It uses a webpack plugin that automatically generates an SSL certificate at runtime, but when I last tried to use it there were trust issues.zengchuan commentedon Jul 11, 2020
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
JesusSPC commentedon Sep 25, 2020
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.
JesusSPC commentedon Sep 30, 2020
I managed to make the --ssl flag work by including another override in:
node_modules/@capacitor/android/capacitor/src/main/java/com/getcapacitor/BridgeWebViewClient.java
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.
Schwankenson commentedon Nov 28, 2020
Thank you, this works for me!
But it is of course not a good solution to make changes in a node module. Would be great to have a fix in a clean way.
Patric commentedon Jan 10, 2021
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?
Schwankenson commentedon Nov 3, 2021
Any news on this? I need to run the livereload with ssl. And the hack works, but is really annoying.
Schwankenson commentedon Nov 4, 2021
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
mkcert -CAROOT) and drag it to the simulator.In Android it can be installed and works in browser, but it is not compiled in Android Studio without the hack from @JesusSPC
reslear commentedon May 9, 2022
thx @Schwankenson )
Adopting for vue3 vite and walletconnect web3 provider
install and configure https://github.com/liuweiGL/vite-plugin-mkcert
run vue dev server
pnpm dev --host="0.0.0.0" --port=8100npx ionic cap run ios --external --livereload-url="https://192.168.100.3:8100/"graemeenglish commentedon May 10, 2022
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.
ionic cap run android -l --external --ssl -- --ssl-cert ssl\live_reload.crt --ssl-key ssl\live_reload.keyAt 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.
AlvaroLarumbe commentedon Jun 17, 2022
Thanks @graemeenglish
I'm using
mkcert 192.168.1.153for example and also works great if you want a simplified cert generation.For people following this approach, you also need to add this to your
AndroidManifest.xmlintoapplicationnode:Reference: https://developer.android.com/training/articles/security-config?msclkid=44f9be68d04d11eca3865cb4143ff1d6#manifest
feat(serve): support `--ssl` for dev-server
avalanche1 commentedon Mar 3, 2023
Ionic 6 here. Still no out-of-the-box solution for running live-reload over https on a physical device...
dpa99c commentedon May 31, 2023
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
vue.config.jsto configure the certificate:joaogabriel-ar commentedon Dec 12, 2023
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 ?