You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Janne Jalkanen <ja...@ecyrd.com> on 2010/09/09 16:42:44 UTC

ssl.port?

Heya!

How do I tell shiro that my SSL sits on 8443 instead of 443, if my http port is 8080? The following does not work:

[main]
ssl.port = 8443

[urls]
/admin/** = ssl

Access to http://host:8080/admin/foo redirects to https://host:8080/admin/foo, not https://host:8443/admin/foo.

Am I misunderstanding something about the configuration?

(It looks to me like PortFilter.onAccessDenied() appends the request.getServerPort() instead of the port. If I now read this correctly [might not, this is my first foray into Shiro source], it appears that you can only have SSL on 443 or 80, or else it must be on the same port as the request itself (?))

/Janne

Re: ssl.port?

Posted by Les Hazlewood <lh...@apache.org>.
I just looked at the code for this, and I think all that is required
is to change PortFilter's line 110 from:

sb.append(request.getServerPort());

to:

sb.append(port);

That should do the trick.

I'll commit shortly.

On Thu, Sep 9, 2010 at 12:02 PM, Les Hazlewood <lh...@apache.org> wrote:
> Thanks!
>
> On Thu, Sep 9, 2010 at 11:34 AM, Janne Jalkanen
> <Ja...@ecyrd.com> wrote:
>>
>> Done. https://issues.apache.org/jira/browse/SHIRO-190
>>
>> /Janne
>>
>> On Sep 9, 2010, at 20:58 , Les Hazlewood wrote:
>>
>>> Hi Janne,
>>>
>>> I remember having a problem with this myself a while ago and I had to
>>> come up with a custom fix.  Could you please open a Jira issue?  I can
>>> contribute that fix back to the project - it just slipped my mind.
>>>
>>> Thanks,
>>>
>>> Les
>>>
>>> On Thu, Sep 9, 2010 at 7:42 AM, Janne Jalkanen <ja...@ecyrd.com>
>>> wrote:
>>>>
>>>> Heya!
>>>>
>>>> How do I tell shiro that my SSL sits on 8443 instead of 443, if my http
>>>> port is 8080? The following does not work:
>>>>
>>>> [main]
>>>> ssl.port = 8443
>>>>
>>>> [urls]
>>>> /admin/** = ssl
>>>>
>>>> Access to http://host:8080/admin/foo redirects to
>>>> https://host:8080/admin/foo, not https://host:8443/admin/foo.
>>>>
>>>> Am I misunderstanding something about the configuration?
>>>>
>>>> (It looks to me like PortFilter.onAccessDenied() appends the
>>>> request.getServerPort() instead of the port. If I now read this correctly
>>>> [might not, this is my first foray into Shiro source], it appears that you
>>>> can only have SSL on 443 or 80, or else it must be on the same port as the
>>>> request itself (?))
>>>>
>>>> /Janne
>>
>>
>

Re: ssl.port?

Posted by Les Hazlewood <lh...@apache.org>.
Thanks!

On Thu, Sep 9, 2010 at 11:34 AM, Janne Jalkanen
<Ja...@ecyrd.com> wrote:
>
> Done. https://issues.apache.org/jira/browse/SHIRO-190
>
> /Janne
>
> On Sep 9, 2010, at 20:58 , Les Hazlewood wrote:
>
>> Hi Janne,
>>
>> I remember having a problem with this myself a while ago and I had to
>> come up with a custom fix.  Could you please open a Jira issue?  I can
>> contribute that fix back to the project - it just slipped my mind.
>>
>> Thanks,
>>
>> Les
>>
>> On Thu, Sep 9, 2010 at 7:42 AM, Janne Jalkanen <ja...@ecyrd.com>
>> wrote:
>>>
>>> Heya!
>>>
>>> How do I tell shiro that my SSL sits on 8443 instead of 443, if my http
>>> port is 8080? The following does not work:
>>>
>>> [main]
>>> ssl.port = 8443
>>>
>>> [urls]
>>> /admin/** = ssl
>>>
>>> Access to http://host:8080/admin/foo redirects to
>>> https://host:8080/admin/foo, not https://host:8443/admin/foo.
>>>
>>> Am I misunderstanding something about the configuration?
>>>
>>> (It looks to me like PortFilter.onAccessDenied() appends the
>>> request.getServerPort() instead of the port. If I now read this correctly
>>> [might not, this is my first foray into Shiro source], it appears that you
>>> can only have SSL on 443 or 80, or else it must be on the same port as the
>>> request itself (?))
>>>
>>> /Janne
>
>

Re: ssl.port?

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
Done. https://issues.apache.org/jira/browse/SHIRO-190

/Janne

On Sep 9, 2010, at 20:58 , Les Hazlewood wrote:

> Hi Janne,
>
> I remember having a problem with this myself a while ago and I had to
> come up with a custom fix.  Could you please open a Jira issue?  I can
> contribute that fix back to the project - it just slipped my mind.
>
> Thanks,
>
> Les
>
> On Thu, Sep 9, 2010 at 7:42 AM, Janne Jalkanen <janne.jalkanen@ecyrd.com 
> > wrote:
>> Heya!
>>
>> How do I tell shiro that my SSL sits on 8443 instead of 443, if my  
>> http port is 8080? The following does not work:
>>
>> [main]
>> ssl.port = 8443
>>
>> [urls]
>> /admin/** = ssl
>>
>> Access to http://host:8080/admin/foo redirects to https://host:8080/admin/foo 
>> , not https://host:8443/admin/foo.
>>
>> Am I misunderstanding something about the configuration?
>>
>> (It looks to me like PortFilter.onAccessDenied() appends the  
>> request.getServerPort() instead of the port. If I now read this  
>> correctly [might not, this is my first foray into Shiro source], it  
>> appears that you can only have SSL on 443 or 80, or else it must be  
>> on the same port as the request itself (?))
>>
>> /Janne


Re: ssl.port?

Posted by Les Hazlewood <le...@hazlewood.com>.
Hi Janne,

I remember having a problem with this myself a while ago and I had to
come up with a custom fix.  Could you please open a Jira issue?  I can
contribute that fix back to the project - it just slipped my mind.

Thanks,

Les

On Thu, Sep 9, 2010 at 7:42 AM, Janne Jalkanen <ja...@ecyrd.com> wrote:
> Heya!
>
> How do I tell shiro that my SSL sits on 8443 instead of 443, if my http port is 8080? The following does not work:
>
> [main]
> ssl.port = 8443
>
> [urls]
> /admin/** = ssl
>
> Access to http://host:8080/admin/foo redirects to https://host:8080/admin/foo, not https://host:8443/admin/foo.
>
> Am I misunderstanding something about the configuration?
>
> (It looks to me like PortFilter.onAccessDenied() appends the request.getServerPort() instead of the port. If I now read this correctly [might not, this is my first foray into Shiro source], it appears that you can only have SSL on 443 or 80, or else it must be on the same port as the request itself (?))
>
> /Janne