Bug 1249496 - "Submit job" button redirects to 'http' URL when it should be 'https' URL
Summary: "Submit job" button redirects to 'http' URL when it should be 'https' URL
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: web UI
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 21.1
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-03 08:00 UTC by Jun'ichi NOMURA
Modified: 2015-10-21 03:25 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-10-21 03:25:32 UTC
Embargoed:


Attachments (Terms of Use)

Description Jun'ichi NOMURA 2015-08-03 08:00:37 UTC
Description of problem:
  "Submit job" button redirects to 'http' URL when it should be 'https' URL

Version-Release number of selected component (if applicable):
  beaker-server-20.1-1.el6eng

How reproducible:
  Always if the lab is configured to use https

Steps to Reproduce:
  1. Go to Scheduler->Reserve page from web UI
  2. Enter provisioning parameters
  3. Press "Submit job" button

Expected results:
  Redirected to 'https' URL if your lab is configured to use 'https'.

Actual results:
  Redirected to 'http' URL and get error.

Additional information:
  The same problem is observed with "Add+" button in Systems page.

  I set 'https' in tg.url_scheme of /etc/beaker/server.cfg.
  This is a regression from 0.18.

Comment 1 Dan Callaghan 2015-08-13 04:41:29 UTC
I think the problem is that we are relying on Flask to convert the Location header to absolute URLs in these cases, and it isn't aware of the TurboGears config. I expect it will use the URL scheme from wsgi.url_scheme which will be set to 'http' if mod_wsgi thinks it is serving the application over HTTP, which is what happens if you serve the application over HTTP with a reverse proxy in front doing SSL termination...

Comment 2 Dan Callaghan 2015-08-17 01:55:30 UTC
http://gerrit.beaker-project.org/4348

Comment 3 Dan Callaghan 2015-08-17 01:58:33 UTC
This is only reproducible if:
* the server is configured to use HTTPS (tg.url_scheme="https" in /etc/beaker/server.cfg)
* the redirect to HTTPS is not enabled (RewriteCond and RewriteRule in /etc/httpd/conf.d/beaker-server.conf not uncommented)
* the application is accessed over HTTP, or there is an SSL-terminating reverse proxy which accesses the application over HTTP

None of our environments have this configuration which is why we haven't spotted the problem before.

Comment 4 Dan Callaghan 2015-08-26 06:43:08 UTC
This bug fix is included in beaker-server-21.1-0.git.3.58733b1.el6eng, which is currently available for download here:

https://beaker-project.org/nightlies/release-21/RedHatEnterpriseLinux6/

Comment 7 Dan Callaghan 2015-10-21 03:25:32 UTC
Beaker 21.1 has been released.


Note You need to log in before you can comment on or make changes to this bug.