After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769940 - Portal helper should load a URI that doesn't redirect to a secure page
Portal helper should load a URI that doesn't redirect to a secure page
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: portal-helper
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2016-08-15 15:21 UTC by Michael Catanzaro
Modified: 2016-12-03 03:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to debug load-changed and load-failed-with-tls-errors from WebKitWebView (1.12 KB, patch)
2016-09-29 14:47 UTC, Debarshi Ray
none Details | Review
Debug logs from debug load-changed and load-failed-with-tls-errors (2.28 KB, text/plain)
2016-09-29 15:13 UTC, Debarshi Ray
  Details
portalHelper: Address intermittent TLS failures (1.98 KB, patch)
2016-10-24 13:22 UTC, Debarshi Ray
committed Details | Review
portalHelper: Use a constant for the host name and URI (1.90 KB, patch)
2016-10-24 14:59 UTC, Debarshi Ray
committed Details | Review

Description Michael Catanzaro 2016-08-15 15:21:10 UTC
I suspect our http://www.gnome.org/ -> https://www.gnome.org/ redirection is causing problems with our portal helper. We should load some other page that doesn't redirect to a secure URI. It should be some page set up for this purpose, bug #750941.
Comment 1 dimitris 2016-08-19 16:03:11 UTC
I seem to have come across a portal that redirects to a HTTPS portal with a "bad" certificate, even though the connectivity check starts with Fedora's http URL:

https://bugzilla.redhat.com/show_bug.cgi?id=1362449
Comment 2 Debarshi Ray 2016-09-29 14:46:07 UTC
FYI, a few people were having problems with the portal-helper at Flock and GUADEC. The WebKitWebView would fail to offer the portal authentication page with:
 (a) "Peer failed to perform TLS handshake", or
 (b) "unacceptable TLS certificate"

Michael and I hacked up gnome-shell-3.20.3 to add some extra debug information to find out what is happening. I will shortly attach the patch and the logs, so that they don't sit all alone on my laptop.
Comment 3 Debarshi Ray 2016-09-29 14:47:31 UTC
Created attachment 336527 [details] [review]
Patch to debug load-changed and load-failed-with-tls-errors from WebKitWebView
Comment 4 Debarshi Ray 2016-09-29 15:13:23 UTC
Created attachment 336528 [details]
Debug logs from debug load-changed and load-failed-with-tls-errors

I got these via e-mail. I am surprised that there is no load-failed-with-tls-errors, so it makes me think that they are probably incomplete.
Comment 5 Debarshi Ray 2016-10-07 19:16:21 UTC
(In reply to Debarshi Ray from comment #2)
> FYI, a few people were having problems with the portal-helper at Flock and
> GUADEC. The WebKitWebView would fail to offer the portal authentication page
> with:
>  (a) "Peer failed to perform TLS handshake", or
>  (b) "unacceptable TLS certificate"

I am sitting at an airport with a captive portal and getting this error. When the portal-helper shows the WebKitWebView with one of the above error messages, if I run a simple program that just calls webkit_web_view_load_uri with http://www.gnome.org/ then it does loads the portal successfully.

I wonder if it is only the first attempt that fails, but that will need some more digging because I am not fast enough to invoke a.out before the portal-helper kicks in.
Comment 6 Debarshi Ray 2016-10-07 19:35:47 UTC
(In reply to Debarshi Ray from comment #5)
> I wonder if it is only the first attempt that fails, but that will need some
> more digging because I am not fast enough to invoke a.out before the
> portal-helper kicks in.

If I nuke gnome-shell-portal helper by chmoding it to 644 (somehow pointing the D-Bus service file to invoke a different binary didn't work), and manually run a.out after it connects to the network, I can reproduce the failure. Merely running it a second time doesn't make it go away either, which makes me curious why it was working earlier when run after the portal helper kicked in. Strange.

If I point webkit_web_view_load_uri to http://nmcheck.gnome.org/, then it does load the portal, but trying to load http://www.gnome.org/ after that fails again.

I'll have to board my flight in another 10 minutes, so I don't have much time to debug this right now. Maybe we should just point it to http://nmcheck.gnome.org/? It was created for similar purposes (for NM's connectivity check), after all.
Comment 7 Debarshi Ray 2016-10-24 13:22:31 UTC
Created attachment 338342 [details] [review]
portalHelper: Address intermittent TLS failures

Completely untested.
Comment 8 Michael Catanzaro 2016-10-24 13:25:29 UTC
Really should use a constant instead of open-coding it in three different places, though
Comment 9 Debarshi Ray 2016-10-24 14:59:46 UTC
Created attachment 338357 [details] [review]
portalHelper: Use a constant for the host name and URI

Again, untested.
Comment 10 Debarshi Ray 2016-11-23 20:40:36 UTC
Comment on attachment 338342 [details] [review]
portalHelper: Address intermittent TLS failures

Pushed to master, gnome-3-22 and gnome-3-20.
Comment 11 Debarshi Ray 2016-11-23 20:40:55 UTC
Comment on attachment 338357 [details] [review]
portalHelper: Use a constant for the host name and URI

Pushed to master.
Comment 12 Debarshi Ray 2016-11-23 20:45:27 UTC
I tested these out at a Starbacks outlet. Sadly, I failed to reproduce the original error this time, so I can't tell whether this actually fixed anything or not. It was failing all the time at the airport, but it wasn't failing at Flock before that.

Anyway, these patches don't seem to have caused a regression. At least not on this network.
Comment 13 Michael Catanzaro 2016-12-03 03:50:13 UTC
(In reply to dimitris from comment #1)
> I seem to have come across a portal that redirects to a HTTPS portal with a
> "bad" certificate, even though the connectivity check starts with Fedora's
> http URL:
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1362449

By the way, this won't fix that portal. I don't think we need to support portals that use invalid certificates on their capture pages, since such portals are surely broken with all browsers and operating systems.