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

iOS WebView doesn't use https #758

Closed
ArmorDarks opened this issue Aug 21, 2018 · 12 comments
Closed

iOS WebView doesn't use https #758

ArmorDarks opened this issue Aug 21, 2018 · 12 comments
Labels

Comments

@ArmorDarks
Copy link

ArmorDarks commented Aug 21, 2018

Version

1.0.0-beta.6

Platfrom

iOS built application

Issue

iOS localhost is loaded with http protocol.

It results in issue with some services, which stricly requring secure connection.

For instance, when navigation.geolocation.watchPosition() used, it results in following error:

image

@ajayak
Copy link

ajayak commented Sep 10, 2018

Any update on this issue??

@ArmorDarks, on a side note, how to access these logs in ios device? 😄

@ArmorDarks
Copy link
Author

ArmorDarks commented Sep 10, 2018

@ajayak Basically, install Safari Tech Preview, launch it, enable Develop menu, then launch Xcode and run your app in the simulator.

After that you should see in Safari Develop menu entry iPhone Simulator, and there should be your launched simulator instance. Just run it and you'll see devtools for launched WebView.

@ghenry22
Copy link

I doubt this will be changed, GCD we Server which is used on iOS specifically does not support HTTPS I believe.

@ArmorDarks
Copy link
Author

Wow, that sounds really bad...

@mlynch
Copy link
Contributor

mlynch commented Sep 12, 2018

Regardless, use the native Geolocation Plugin we provide as it will work in this case. Will look into the HTTPS issue here.

@ghenry22
Copy link

Https on a local host only web server is really a waste of time, you don’t use encryption when reading by file protocol for your local files either. Also you can’t get a valid certificate for localhost anyway.

But it would be good to work out what is up with the geolocation plugin regardless.

@jcesarmobile
Copy link
Member

The native geolocation plugin works fine, it's the webview implementation what doesn't work (navigation.geolocation) because it requires https to work.

We use GCDWebServer as the web server and it doesn't support https, nor it's going to support it in the future, so to "fix" this we will have to use a different web server with https support, or use a custom scheme instead of http: or https:, but that's only supported on iOS 11+, and I'm not really sure navigation.geolocation will work with a custom scheme.

Closing it for now as the rest of issues tagged with feature request tag.
If you are interested in https feature add the +1 reaction (thumbs up)on the issue as we use it to gauge interest on feature request issues.

@ArmorDarks
Copy link
Author

Sadly to see how on Apple devices everything screwed up. Like, they really hate developers.

I have a feeling that http-only will eventually result in other issues with mixed content anyway.

@jcesarmobile
Copy link
Member

changing from feature request to won't do, we have removed the web server and we are using capacitor:// as scheme and won't change it to https

@ArmorDarks
Copy link
Author

I assume this is a good thing.

Not that proper place to ask, but still — how iOS treats such a scheme? Like it is a https or not? Will it complain about mixed content?

@glebmachine
Copy link

any news? this is still a problem(

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants