Use the livereload feature with secure context enabled (https)

Hey,

I’ve been going through the docs and the forums but didn’t find a suitable answer for my question. I am currently developing an app which needs access to the crypto.subtle functions on the window scope. Those are only available in so called “secure origins” (e.g. localhost, file:// or https).
I’ve been fiddling around with the “ionic capacitor run android” command, but could only get it to serve the dev server with http (–https worked, but the app does not like self signed certificates). How can I achieve this? Maybe with a proxy (ngrok etc)?

Thanks in advance!

1 Like

We also use crypto.subtle functions. For example when I deploy our app via
ionic cap run android -l --external on physical device

It throws "Cannot read properties of undefined (reading 'digest')"
when we call crypto.subtle.digest(..., ...)

But if I run same project via Android Studio its working fine.

@Dwynr is there any way you figured out this issue?

Try ionic cap run ios -l --external --ssl and see if it can use web crypto apis in live reload.