Skip to content

Conversation

@arpitgandhi9
Copy link
Contributor

@arpitgandhi9 arpitgandhi9 commented Jun 26, 2022

Pass locally generated certificate via command line

Fixes: #60704

Added ARGS:

  • web-tls-cert-path
  • web-tls-cert-key-path

Passing the path of local certificate and the key to cert will allow flutter tool to create a secure debugging session on chrome

Pre-launch Checklist

✅ I read the Contributor Guide and followed the process outlined there for submitting PRs.
✅ I read the Tree Hygiene wiki page, which explains my responsibilities.
✅ I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
✅ I signed the CLA.
✅ I listed at least one issue that this PR fixes in the description above.
✅ I updated/added relevant documentation (doc comments with ///).
✅ I added new tests to check the change I am making.
✅ All existing and new tests are passing.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 26, 2022
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@arpitgandhi9
Copy link
Contributor Author

arpitgandhi9 commented Jun 26, 2022

could #103230 be the issue for Windows framework_tests_misc to fail?

@c-seeger
Copy link

this would be awesome if we get this merged!

@christopherfujino christopherfujino added the platform-web Web applications specifically label Jul 21, 2022
@christopherfujino
Copy link
Contributor

I pinged the discord chat about looking at this PR

@christopherfujino
Copy link
Contributor

I pinged the discord chat about looking at this PR

Following up from a discussion thread on the discord, it sounds like this isn't actually needed for most developer use cases. @ditman & @yjbanov shall we close this as won't fix?

@c-seeger
Copy link

It would be extremely helpful to get this. I'm currently working on an app using SSO provider that require TLS to be present currently I need to proxy the requests to do the same or run flutter build web and use a webserver with https to serve these files.

@christopherfujino
Copy link
Contributor

I'm sorry, but I am going to be closing this PR as something we are not able to support at this time.

@jacobwardio
Copy link

@christopherfujino why are you unable to support at this time?

@c-seeger
Copy link

I pinged the discord chat about looking at this PR

Following up from a discussion thread on the discord, it sounds like this isn't actually needed for most developer use cases. @ditman & @yjbanov shall we close this as won't fix?

@christopherfujino, @ditman, @yjbanov I'm not sure if this is true here.

This is a web only feature since you only need it for flutter web development, mobile or desktop does not need this. So when asking flutter developers if this is a needed feature, all that use flutter only for mobile or desktop development will say no.

For web development it is nessesary since TLS is a requirement for many 3rd party integrations. So the question should go to flutter web developers and according to this issue and #60704 there is enough evidence that this feature is needed.

As already stated in the mentioned issue, without this feature you have to use flutter in a crippled way when developing since you lose the hot reload as well as device specific debug features that come with flutter run which is not usable without providing a way to make TLS work once you hit the TLS barrier of a 3rd party integration. Most commonly SSO providers! Which is a very common use case for web applications.

Currently flutter is not widely adapted to be used for web applications yet, and in my opinion having no support for TLS with flutter run is one big entry barrier here.

@ditman
Copy link
Member

ditman commented Jan 18, 2023

TLS is a requirement for many 3rd party integrations.

@c-seeger can you please be more specific about this? "many" sounds to me like a weasel word in this discussion, but concrete use cases would go a long way to sell the value of this feature, and re-prioritize its landing.

All browsers now consider localhost as a secure context1, so what I'm wondering is:

Is flutter run the right layer at which this fix needs to be applied, or should this be fixed by the 3rd party that requires https in localhost for their service? (And what's the threat model that inspired that requirement on the 3rd party?)

the question should go to flutter web developers

The question did go to our Discord channel #hackers-web (invite link to the server here). I asked for use cases for this, and didn't get an answer.

It is also unclear that this would fix the original issue (Chrome refusing to auto-fill CC fields), see this SO answer (and a fix without certs).

Footnotes

  1. https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#when_is_a_context_considered_secure

@c-seeger
Copy link

c-seeger commented Jan 18, 2023

Thanks @ditman for your quick reply.

You are right concret use cases are needed:

I'm currently developing a web/mobile application that uses SSO logins (google, facebook, apple).

The usual workflow here is

  • Browser send request to google/facebook/apple
  • Browser gets a token back and sends it to our backend
  • Our backend validates the SSO token and replies with JWT token (for web in form of http secure only cookie)

Currently if I just use flutter run I only get http://localhost and requesting from http all SSO provider refuse the request due to missing TLS of the requesting origin. I also tried the chrome insecure origins thread as secure which wasn't working for me either, i still get the same result, since the SSO providers enforce the origin to use TLS.

The current workaround I'm using is running a webserver with TLS and using flutter build web instead of using flutter run .

This comes with costs like no hot reload, which slows down implementation speed :(.

The question did go to our Discord channel #hackers-web (invite link to the server here). I asked for use cases for this, and didn't get an answer.

I'm sorry I wasn't aware of this but will join the discord as well (thanks for the link).

It is also unclear that this would fix the original issue (Chrome refusing to auto-fill CC fields), see this SO answer (and a fix without certs).

Thats indeed a good question since I only run into TLS issues using 3rd party integrations, I can not answer this.

Other examples from the #60704

  • auto-fill CC (as mentioned unclear)
  • authentication (google, apple, facebook, ... my guess is this is also true for all other SSO providers like github, etc)
  • grpc backend (no additional context mentioned)
  • payment service (indeed!)
  • firebase features (not exactly mentioned which ones)

I hope this helps in clarifying the use cases a bit more. Any solution that helps to make flutter run working with the TLS requirement is very appreciated. Thanks again for taking care of this ❤️

@c-seeger
Copy link

c-seeger commented Jan 18, 2023

an addition:

Is flutter run the right layer at which this fix needs to be applied, or should this be fixed by the 3rd party that requires https in localhost for their service? (And what's the threat model that inspired that requirement on the 3rd party?)

for authentication (as well as payment) it makes sense to enforce the origin to have TLS no matter if it's just a test environment or not. The attack vector here would be the possibility of a network intruder to be able to read sensible data via MITM by modifying the calling page.

https://stackoverflow.com/questions/7594193/calling-https-from-http-through-ajax-for-login

@nicktgn
Copy link

nicktgn commented Jun 8, 2023

Any plans to get this merged?
As clearly stated by multiple examples in #60704, it is a very much needed feature for proper adoption of flutter as tool for building web apps (in addition to mobile and desktop).

@Schwusch
Copy link

Schwusch commented Jun 8, 2023

It is a pain to work with APIs like WebUSB/WebSerial/WebNFC or Credential Management API which require HTTPS.
My current workaround is to use package:flutter_cors to turn off all security while testing, but that does not help with WebNFC, since it only exists on Android, where I can't turn security off.

@ditman
Copy link
Member

ditman commented Jun 20, 2023

(I've been convinced that we should land this (or a similar version). It'll happen, especially if anybody other than myself refreshes this PR and brings it to mergeability :) )

@arpitgandhi9
Copy link
Contributor Author

@ditman Merged and pushed. You can reopen this if required?

@ditman ditman reopened this Jun 21, 2023
@ditman
Copy link
Member

ditman commented Jun 21, 2023

@arpitgandhi9 this is failing CLA with the user @arpitignite (are both accounts yours?)

@arpitignite
Copy link

Yes. that's my other account. Let me fix this

@arpitgandhi9
Copy link
Contributor Author

@ditman Changes done. Please check

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSLGTM

@christopherfujino christopherfujino added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 16, 2023
@auto-submit auto-submit bot merged commit 428bff1 into flutter:master Nov 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 18, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 18, 2023
flutter/flutter@53a57ad...6cf9ab0

2023-11-18 [email protected] Roll Flutter Engine from 53c4fde7732b to d7af5fb60b4c (2 revisions) (flutter/flutter#138668)
2023-11-18 [email protected] Update release.yml (flutter/flutter#138561)
2023-11-18 [email protected] Roll Flutter Engine from 384f75061257 to 53c4fde7732b (2 revisions) (flutter/flutter#138660)
2023-11-18 [email protected] Roll Flutter Engine from 5f40c9f49f88 to 384f75061257 (2 revisions) (flutter/flutter#138658)
2023-11-18 [email protected] Roll Flutter Engine from 66f764a16610 to 5f40c9f49f88 (1 revision) (flutter/flutter#138655)
2023-11-18 [email protected] Roll Flutter Engine from 1d2ee544c5e5 to 66f764a16610 (1 revision) (flutter/flutter#138652)
2023-11-18 [email protected] Roll Flutter Engine from c38272b5e036 to 1d2ee544c5e5 (3 revisions) (flutter/flutter#138650)
2023-11-17 [email protected] Roll Flutter Engine from e010f17eeb10 to c38272b5e036 (4 revisions) (flutter/flutter#138647)
2023-11-17 [email protected] Update links and surrounding text for new `main-api` docs (flutter/flutter#138602)
2023-11-17 [email protected] Roll Flutter Engine from 141a01c5c70b to e010f17eeb10 (2 revisions) (flutter/flutter#138643)
2023-11-17 [email protected] Roll Flutter Engine from 90c3ada3682c to 141a01c5c70b (16 revisions) (flutter/flutter#138637)
2023-11-17 [email protected] Roll Flutter Engine from 5064aeff00de to 90c3ada3682c (9 revisions) (flutter/flutter#138599)
2023-11-17 [email protected] Fix NoSplash not being disposed (flutter/flutter#138542)
2023-11-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Introduce `AnimationStyle`" (flutter/flutter#138628)
2023-11-17 [email protected] Enable `flutter screenshot` outside Flutter project directory (flutter/flutter#138160)
2023-11-17 [email protected] Roll Flutter Engine from aae07e989b0a to 5064aeff00de (2 revisions) (flutter/flutter#138585)
2023-11-16 [email protected] Improves output file path logic in Android analyze (flutter/flutter#136981)
2023-11-16 [email protected] Turn off leak tracker in master to make found leaks not blocking. (flutter/flutter#138567)
2023-11-16 [email protected] Roll Flutter Engine from 094a3383a406 to aae07e989b0a (2 revisions) (flutter/flutter#138574)
2023-11-16 [email protected] Enable the silent flag for invalid string exceptions when building a TextSpan (flutter/flutter#138564)
2023-11-16 [email protected] Roll Flutter Engine from 22baa83db63b to 094a3383a406 (13 revisions) (flutter/flutter#138568)
2023-11-16 [email protected] #60704: Pass cert for TLS localhost connection (flutter/flutter#106635)
2023-11-16 [email protected] Bump cupertino_icons to 1.0.6 (flutter/flutter#136962)
2023-11-16 [email protected] Fix sliver persistent header expand animation (flutter/flutter#137913)
2023-11-16 [email protected] Reduce animations further when --no-cli-animations is set. (flutter/flutter#133598)
2023-11-16 [email protected] Roll Flutter Engine from 0c57a50810e8 to 22baa83db63b (4 revisions) (flutter/flutter#138560)
2023-11-16 [email protected] Introduce `AnimationStyle` (flutter/flutter#137945)
2023-11-16 [email protected] Just use string interpolation for ws url for tests (flutter/flutter#138235)
2023-11-16 [email protected] Adding new packages to the first-party package issue template (flutter/flutter#138540)
2023-11-16 [email protected] Roll Packages from 0cd2378 to 07b4b29 (3 revisions) (flutter/flutter#138549)
2023-11-16 [email protected] Roll Flutter Engine from 2e9f0df868b3 to 0c57a50810e8 (1 revision) (flutter/flutter#138546)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@jwalton
Copy link

jwalton commented Feb 14, 2024

I spent a while banging my head against a wall trying to get nginx to forward to flutter, before I discovered this PR has already fixed this. Could some admin (@ditman @christopherfujino ??) please go add a comment to the bottom of #60704 to let people know this PR has been merged and this is fixed in master? Many thanks!

@ditman
Copy link
Member

ditman commented Feb 14, 2024

Good call @jwalton, I just added a comment at the end of the locked issue. Thanks for flagging this!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2024
@arpitgandhi9 arpitgandhi9 deleted the 60704 branch June 22, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Web applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a way to serve localhost through HTTPS