-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Dart/Pub HTTP Certificate Issues #45939
Comments
What does this mean? Does the connection between the client and proxy use TLS or just HTTP? I'm confused would the proxy behave differently if (Maybe I'm not fully updated on how HTTP proxies work). Did this use to work? We've recently seen
Consider posting a gist for completeness :)
That sounds like a problem. It's probably reasonable to have a way to use self-signed certificates with Dart SDK. Just to clarify:
I'm unsure why this is...? is the proxy man-in-the-middle inspecting TLS connections, but unable to do so for certain certificates? without having to use an internal self-signed certificate that you would have to install into the Dart certificate store (or windows certificate store, if Dart SDK is using those). |
This behavior is not for every site. When I view www.microsoft.com both on the network and off the network I see the certificate chain from the host server, not the internal chain. This points to the proxy using the internal certificates to ensure a valid HTTPS connection on the internal network when it does not have the up to date certificates for the host server.
It did work in the past. I had to stop my Dart development for a while due to another project. I encountered this when I returned to my code a few months ago. I wish I could post a gist of my changes. My organization blocks gist for some reason. The only change was to the
I am not privy to the details of the network configuration. I can only test various possibilities and draw conclusions from the results. I did test
The more I think about this issue, the more I think I should post this in the A fix for this in Dart itself does not make much sense. A developer that writes something using HTTP that wants to allow this functionality can do it in the implementation of |
So maybe the proxy is allowing traffic for I hope the proxy doesn't have keys to pretend to be
It might make sense to ensure that Dart is correctly using the system certificate stores on windows. I think it's a lot better to have the Dart SDK using system certificates rather than expanding |
I have done extensive research on this issue prior to this post. I have been scouring open and closed issues on Github and any form of related posts on Stack Overflow. I am using Dart 2.12.4 on Windows 10.
I feel I should set the stage regarding my environment. I have no control over the network configuration. I do not have administrator privileges on my machine. I am unable (and unwilling) to disable the virus scanner. I am unable to update most applications myself. I am behind a proxy. The proxy automatically uses an internal CA and certificate chain if a site's certificates are not already available in the certificate store on the proxy.
I have done extensive testing using the certificate check code from dart-lang/pub#983 posted by DartBot on June 5, 2015. I modified it to comply with null safety but otherwise left it intact.
Here are the tests I have performed. All tests have the HTTP_PROXY variables set. Without them set, I get semaphore timeout errors on all connections. The results of these tests are the same when certificates are provided via the DART_VM_OPTIONS variable.
SecurityContext.setTrustedCertificates
. The bad certificate callback is executed.SecurityContext.useCertificateChain
. The bad certificate callback is executed.I have verified that every certificate in the certificate path are installed on my machine and match the ones used by the proxy.
My own code is easy to fix. I set the bad certificate callback to return true and everything moves along just fine. I would prefer not to do that but it is the only option available.
I have a problem with Pub not providing the ability to specify trusted hosts or disable strict SSL checks. It has been made abundantly clear that Dart uses an internal certificate database and that there is no way to append/supplement that. There was an update recently that stated that Dart would use the Windows certificate store but that appears to not work.
The text was updated successfully, but these errors were encountered: