Is there a way to configure ionic to serve locally using https?
My remote host is SSL and all secure cookies are lost when they come back to the non-SSL browser.
What is the easiest way to solve my problem?
Thanks in advance.
Is there a way to configure ionic to serve locally using https?
My remote host is SSL and all secure cookies are lost when they come back to the non-SSL browser.
What is the easiest way to solve my problem?
Thanks in advance.
Can you give an example of what you are trying to do. Why would you be serving https from ionic?
after I logged in to SSL server it sends back secure cookie with sessionId.
I need that cookie to make other requests BUT non-SSL browser mode doesnāt allow to share secure cookies.
As a result I can not sent sessionId and have 401 āUnauthorizedā response from a server.
after I logged in to SSL server it sends back secure cookie with sessionId.
So is your ionic app connecting to a server using SSL or is it Serving SSL?
In reality the last request doesnāt have sessionId in requestHeader coockie and thats why I get 401 āUnauthorizedā.
When I look at responseHeader cookie of the first request I see the following:
set-cookie:PHPSESSID=5583u6dcq803qlm5mnnc79vua4i0hs10htoj1mavskhv0bdg8m31; path=/; secure; HttpOnly
My idea is to make it somehow run locally in secure mode so that this secure cookie would be passed through.
Hey @qvatra !, Im currently facing the same issue. It would be nice to have something like āionic serve httpsā to bootstrap localhost in a secure environment, what is required by a lot of services like google maps, aws cognito, auth0, firebase, etc. Not sure where the confusion is @rwildcard , it is a very common use case. If ionic were using something like browsersync, we could just add our self-signed certs in a config file i.e.:
,āhttpsā: {
ākeyā: ā/Users/rcfrias/.localhost-ssl/key.pemā,
ācertā: ā/Users/rcfrias/.localhost-ssl/cert.pemā
}
@rwildcard what do you mean with -> āWhy would you be serving https from ionicā afaik ionic uses the āserveā command to create a standalone web server to host the ionic app, not to serve anything else. So by āserveā it can only be the app itself. Default -> http://localhost:8100/ / desired -> https://localhost:8100/
I have the same problem, how can we use https://localhost:8100 ?
In my case I canāt use cordova-plugin-geolocation with --livereload because itās forbidden to get geolocation from unsecured origins:
@fdambrosio Did you ever find a solution to this problem? Iām attempting to configure my application to serve through https to fix this exact same problem as well. Pretty disappointed by how complicated most āsolutionsā Iāve come across have been.
Hey, I am also facing the same issue. Did you able to resolve this issue.
Hi @rcfrias,
In my app I use an iframe and I call a website using https. It works just fine, I rarely test my apps with the browser due to the features I need are usually only found on the device. Do you find that it works on the device when you test it or is it a problem that is in both the browser and on your device?
I may run into this with my next app as I will be dropping the iframe and replace it with apiās. @fdambrosio are you making an app or is this to be run on the browser? I just want to make sure I understand this.