[rt-users] http vs https problem

Petr Grolmus indy at civ.zcu.cz
Wed May 16 09:31:18 EDT 2007


Hello,

it seems neither the upgrade to RT 3.6.3 nor comment out the
line "$uri->port($ENV{'SERVER_PORT'});" in Web.pm helped at all. The
latter has a really weird behavior ;) If in RT_SiteConfig.pm is the
version with "https":

Set($WebBaseURL , "https://rtest2.zcu.cz");

then on non-https port (after the click on mentioned submit buttons) it
redirects page to https port (but now without an alert ;-) and vice versa...

I tried to make some experiments and I figured out this "hack" that
seems working... in RT/Interface/Web.pm I replaced the line:

    $HTML::Mason::Commands::m->redirect($uri->canonical);

with next code:

    my $my_redirect = $uri->canonical;
    if ($ENV{'SERVER_PORT'} == 80) {
       $my_redirect =~ s/^https/http/;
    }
    $HTML::Mason::Commands::m->redirect($my_redirect);

It's really dirty hack... but it's working with my settings...

Petr Grolmus


> We ran into that problem as well and we fixed it via this hackish-ness:
>
> in RT/Interface/Web.pm . At around line 194 you will see something that
> looks like this:
>
>     if ($uri->host  eq $server_uri->host &
>         $uri->port eq $server_uri->port) {
>             $uri->host($ENV{'HTTP_HOST'});
>             # $uri->port($ENV{'SERVER_PORT'});
>     }
>
> Make sure that "$uri->port($ENV{'SERVER_PORT'});" is commented out.
>
> If you look at what the webclient is being told to access, it ends up
> being something like "https://<yoursite>:80"- which fails.  I doubt this
> is the correct way to fix this problem, but after it started working we
> kinda lost interest ...

--------------------------------------------------------------------------
 Petr Grolmus

 Laboratory for Computer Science
 University of West Bohemia
 Univerzitni 20, 306 14 Pilsen                      Tel.: +420 377 632 851
 Czech Republic                                    E-mail: indy at civ.zcu.cz
--------------------------------------------------------------------------




More information about the rt-users mailing list