You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by David Rosenstrauch <da...@darose.net> on 2009/11/17 22:24:08 UTC

Problem with SSLRequire

I've recently set up SVN on Apache WebDAV, using SSL, along with LDAP 
authentication.  All's been working like a charm.

However, for various reasons out of my control it's been decided that we 
need to use an alternate port for SSL (81), and that in addition SVN 
should not be accessible over the standard https port of 443.

The 2 SSL ports are set up on the server using a virtual host directive 
(<VirtualHost _default_:443 _default_:81>).  And I thought I'd found the 
correct way to do the restriction by port number, by using Apache's 
SSLRequire directive.  But when I enable that directive, SVN starts 
throwing errors like:

svn: REPORT request failed on '/svn/ourrepo/!svn/vcc/default'
svn: Not authorized to open root of edit operation

It seems that the SSLRequire directive is somehow blocking the SVN 
client from connecting using HTTP REPORT.  But I'm quite puzzled as to 
why that should be the case.  (Particularly because when I query the 
repository on both SSL ports from a web browser all works as expected.)

Although googling turned up a number of pages referring to the same 
error message, I didn't see any concrete solution.  Anyone have any 
wisdom/workarounds on this problem?  Our Apache subversion.conf is 
attached below.

Thanks,

DR

--

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

LDAPSharedCacheSize 200000
LDAPCacheEntries 1024
LDAPCacheTTL 600
LDAPOpCacheEntries 1024
LDAPOpCacheTTL 600

<Location /svn>
    DAV svn
    SVNParentPath /var/svn

    # Require SSL connection for SVN access
    SSLRequireSSL
    # Require SSL over non-obvious port 81 for SVN access
#   SSLRequire %{SERVER_PORT} == 81
#   SSLRequire %{SERVER_PORT} eq "81"

    AuthType Basic
    AuthBasicProvider ldap
    AuthName "Subversion"
    AuthLDAPURL 
ldaps://ldap.ourdomain.com/ou=users,dc=ourdomain,dc=com?uid?one
    AuthLDAPBindDN uid=subversion,ou=system,dc=ourdomain,dc=com
    AuthLDAPBindPassword <one of our system ldap passwords>
    AuthzLDAPAuthoritative off
    Require valid-user
    Require ldap-attribute employeeType=active
</Location>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2419181

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with SVN on Apache using SSLRequire

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Nov 19, 2009, at 10:59, Pat Farrell wrote:

> I've never seen Apache support two hosts on SSL using the usual virtual
> host mapping. I've heard that SSL happens before apache gets to look at
> the host stuff,

That design problem is supposed to have been fixed by "Server Name Indication"

http://en.wikipedia.org/wiki/Server_Name_Indication

I don't know if Subversion supports it. Note this was only added to Apache in 2.2.12.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420133

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with SVN on Apache using SSLRequire

Posted by David Rosenstrauch <da...@darose.net>.
On 11/19/2009 05:58 PM, David Rosenstrauch wrote:
> On 11/19/2009 04:27 PM, David Rosenstrauch wrote:
>> On 11/19/2009 01:36 PM, David Rosenstrauch wrote:
>>> Really then the only possibilities here are either a) I wrote the 
>>> SSLRequire directive wrong, or b) there's some other weirdness happening 
>>> here that I'm not aware of.
>> OK, I've done some more debugging, and the answer is (b).
> 
> Got some more info from the apache logs.
> 
> SVN seems to have a fine conversation with Apache (consisting of 21 
> requests) but fails on the final (REPORT) request.

FYI - one of the guys on the mod_ssl mailing list came up with the 
solution to this issue.  Not sure this matters to anyone here right now, 
but in case someone has this same issue in the future I wanted to have 
the solution on record.

Apparently the magical Apache incantation "UseCanonicalPhysicalPort on" 
ensures that %{SERVER_PORT} gets set to the correct (IMO) value of 81, 
instead of 443, and so lets the SSLRequire directive function correctly.

Go figure.

Thanks,

DR

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420980

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with SVN on Apache using SSLRequire

Posted by David Rosenstrauch <da...@darose.net>.
On 11/19/2009 04:27 PM, David Rosenstrauch wrote:
> On 11/19/2009 01:36 PM, David Rosenstrauch wrote:
>> Really then the only possibilities here are either a) I wrote the 
>> SSLRequire directive wrong, or b) there's some other weirdness happening 
>> here that I'm not aware of.
> 
> OK, I've done some more debugging, and the answer is (b).

Got some more info from the apache logs.

SVN seems to have a fine conversation with Apache (consisting of 21 
requests) but fails on the final (REPORT) request.

Without SSLRequire:

64.245.135.215 - - [19/Nov/2009:22:39:54 +0000] "OPTIONS /<our 
repo>/testing HTTP/1.1" 401 477
...
64.245.135.215 - david [19/Nov/2009:22:39:54 +0000] "PROPFIND /<our 
repo>/!svn/bln/1418 HTTP/1.1" 207 476
64.245.135.215 - david [19/Nov/2009:22:39:54 +0000] "REPORT /<our 
repo>/!svn/vcc/default HTTP/1.1" 200 1249


With SSLRequire:

64.245.135.215 - - [19/Nov/2009:22:41:39 +0000] "OPTIONS /<our 
repo>/testing HTTP/1.1" 401 477
...
64.245.135.215 - david [19/Nov/2009:22:41:39 +0000] "PROPFIND /<our 
repo>/!svn/bln/1418 HTTP/1.1" 207 476
64.245.135.215 - david [19/Nov/2009:22:41:39 +0000] "REPORT /<our 
repo>/!svn/vcc/default HTTP/1.1" 500 241


Again, I have no idea why all the other HTTP requests work fine except 
for that one.  (My knowledge of WebDAV is, unfortunately, a bit limited.)

If anyone's got any idea what's going on here, please let me know.

Thanks,

DR

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420336

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with SVN on Apache using SSLRequire

Posted by David Rosenstrauch <da...@darose.net>.
On 11/19/2009 01:36 PM, David Rosenstrauch wrote:
> Really then the only possibilities here are either a) I wrote the 
> SSLRequire directive wrong, or b) there's some other weirdness happening 
> here that I'm not aware of.

OK, I've done some more debugging, and the answer is (b).

Just to refresh:  I've got my repo on https://...:81 and I'm trying to 
enforce this:

SSLRequire %{SERVER_PORT} == 81


So what's the weirdness I found?

This works:

SSLRequire %{SERVER_PORT} <= 443

while this does not:

SSLRequire %{SERVER_PORT} < 443


So somehow SVN seems to be still requiring access to port 443 - even 
though my repo is on port 81 (e.g., "svn co 
https://...:81/.../repo/testing").

So ... anyone have any idea why this might be the case?  Why might SVN 
still be needing access to port 443?


Thanks,

DR

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420310

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with SVN on Apache using SSLRequire

Posted by David Rosenstrauch <da...@darose.net>.
On 11/19/2009 01:36 PM, David Rosenstrauch wrote:
> Really then the only possibilities here are either a) I wrote the 
> SSLRequire directive wrong, or b) there's some other weirdness happening 
> here that I'm not aware of.

Is there any way to debug the execution of the SSLRequire statement? 
When I crank Apache's debug level up to "debug" (the highest, apparently 
- they don't seem to have a "trace" level), all I see in the logs is:

access to /<path to our svn repo> failed, reason: SSL requirement 
expression not fulfilled (see SSL logfile for more details)

I'm not sure what "SSL logfile" they're talking about that supposedly 
has more details.  I'm seeing this message in 
/var/log/httpd/ssl_error_log - which I assume *is* the SSL logfile.

Thanks,

DR

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420194

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with SVN on Apache using SSLRequire

Posted by David Rosenstrauch <da...@darose.net>.
On 11/19/2009 12:20 PM, Pat Farrell wrote:
> David Rosenstrauch wrote:
>> Hmmmm .... could the "invalid certficate" be causing the issue here?
>> The certficate is considered invalid because a) it's self-signed, and b)
>> the hostname on it doesn't match the URL we're using to access the
>> repository (we're using IP address).  Might SVN be barfing on the bad
>> cert?  If so, is there any way to configure things on the cerver side to
>> ignore this?  (Since it's a self-signed cert, and an internal system,
>> *we* know that it's valid.)
> 
> Yes, I've seen this on other stuff.
> SVN will whine if the cert doesn't match the website name, but you can
> tell SVN to accept it.
> 
> Being self signed is not a big deal, it causes one whine message at
> first, but you can say "accept this permenantly" and all is good.
> 
> I'm not sure that using IP addresses works. Since its internal, setup a
> DNS record to resolve it.
> 
> This stuff is very picky, and its been a while since I chased it down,
> so I don't guarentee that my memory is right. But I think you are in the
> right area now.

On second thought, though, the cert can't be the issue.  When I take out 
the SSLRequire clause, everything works perfectly using https over 
either the standard port 443 or port 81.  It's only when I add the 
"SSLRequire %{SERVER_PORT} == 81" directive that things break.

Really then the only possibilities here are either a) I wrote the 
SSLRequire directive wrong, or b) there's some other weirdness happening 
here that I'm not aware of.

DR

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420143

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with SVN on Apache using SSLRequire

Posted by Pat Farrell <pf...@pfarrell.com>.
David Rosenstrauch wrote:
> Hmmmm .... could the "invalid certficate" be causing the issue here?
> The certficate is considered invalid because a) it's self-signed, and b)
> the hostname on it doesn't match the URL we're using to access the
> repository (we're using IP address).  Might SVN be barfing on the bad
> cert?  If so, is there any way to configure things on the cerver side to
> ignore this?  (Since it's a self-signed cert, and an internal system,
> *we* know that it's valid.)

Yes, I've seen this on other stuff.
SVN will whine if the cert doesn't match the website name, but you can
tell SVN to accept it.

Being self signed is not a big deal, it causes one whine message at
first, but you can say "accept this permenantly" and all is good.

I'm not sure that using IP addresses works. Since its internal, setup a
DNS record to resolve it.

This stuff is very picky, and its been a while since I chased it down,
so I don't guarentee that my memory is right. But I think you are in the
right area now.



-- 
Pat Farrell
http://www.pfarrell.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420118

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with SVN on Apache using SSLRequire

Posted by David Rosenstrauch <da...@darose.net>.
On 11/19/2009 11:59 AM, Pat Farrell wrote:
> David Rosenstrauch wrote:
>> Hmmm ... didn't hear back any responses on this.  Is there anyone out 
>> there with experience running SVN on Apache that might have some idea 
>> what's happening here?  I'm really rather stumped!
>>
>> I can't understand why this Apache configuration performs the 
>> authorization perfectly when the client is a web browser, but fails when 
>> the client is SVN.
> 
> That is a bit strange. But are you sure its working?
> I've never seen Apache support two hosts on SSL using the usual virtual
> host mapping. I've heard that SSL happens before apache gets to look at
> the host stuff,

Over http it's definitely doing the expected behavior:

1) deny http:

[darose@daroselin xfce4]$ w3m -dump
http://${thesvnbox}/${thesubdir}/svn/${thereponame}
Forbidden

You don't have permission to access /<our repo> on this server.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Apache/2.2.3 (CentOS) Server at <our server ip> Port 80



2) deny https: on 443

[darose@daroselin xfce4]$ w3m -dump
https://${thesvnbox}/${thesubdir}/svn/${thereponame}
Bad cert ident mysql-prod from <our server ip>: accept? (y/n)y
Accept unsecure SSL session:Bad cert ident mysql-prod from <our server ip>
Forbidden

You don't have permission to access /<our repo> on this server.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Apache/2.2.3 (CentOS) Server at <our server ip> Port 443



3) allow https: on 81

[darose@daroselin xfce4]$ w3m -dump
https://${thesvnbox}:81/${thesubdir}/svn/${thereponame}
Bad cert ident mysql-prod from <our server ip>: accept? (y/n)y
Accept unsecure SSL session:Bad cert ident mysql-prod from <our server ip>
Username for Subversion: david
Password:
Accept unsecure SSL session:Bad cert ident mysql-prod from <our server ip>
Accept unsecure SSL session:Bad cert ident mysql-prod from <our server ip>
Revision 1413: /

   • admin/
   • custom/
   • db/
   • httpd/
   • portal/
   • testing/
   • utils/
   • website/

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Powered by Subversion version 1.4.2 (r22196).



Hmmmm .... could the "invalid certficate" be causing the issue here?
The certficate is considered invalid because a) it's self-signed, and b)
the hostname on it doesn't match the URL we're using to access the
repository (we're using IP address).  Might SVN be barfing on the bad
cert?  If so, is there any way to configure things on the cerver side to
ignore this?  (Since it's a self-signed cert, and an internal system,
*we* know that it's valid.)

Thanks,

DR

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420116

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with SVN on Apache using SSLRequire

Posted by Pat Farrell <pf...@pfarrell.com>.
David Rosenstrauch wrote:
> Hmmm ... didn't hear back any responses on this.  Is there anyone out 
> there with experience running SVN on Apache that might have some idea 
> what's happening here?  I'm really rather stumped!
> 
> I can't understand why this Apache configuration performs the 
> authorization perfectly when the client is a web browser, but fails when 
> the client is SVN.

That is a bit strange. But are you sure its working?
I've never seen Apache support two hosts on SSL using the usual virtual
host mapping. I've heard that SSL happens before apache gets to look at
the host stuff,

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420109

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Problem with SVN on Apache using SSLRequire

Posted by David Rosenstrauch <da...@darose.net>.
Hmmm ... didn't hear back any responses on this.  Is there anyone out 
there with experience running SVN on Apache that might have some idea 
what's happening here?  I'm really rather stumped!

I can't understand why this Apache configuration performs the 
authorization perfectly when the client is a web browser, but fails when 
the client is SVN.

* What exactly is SVN doing with WebDAV that is making this fail?
* What is an HTTP REPORT request, and why might that be failing here? 
HTTP GET is obviously working perfectly here, since I was able to test 
this successfully when connecting with a browser.  So what's different 
about HTTP REPORT?

Can anyone shed some light here?

Thanks,

DR

On 11/17/2009 05:24 PM, David Rosenstrauch wrote:
> I've recently set up SVN on Apache WebDAV, using SSL, along with LDAP 
> authentication.  All's been working like a charm.
> 
> However, for various reasons out of my control it's been decided that we 
> need to use an alternate port for SSL (81), and that in addition SVN 
> should not be accessible over the standard https port of 443.
> 
> The 2 SSL ports are set up on the server using a virtual host directive 
> (<VirtualHost _default_:443 _default_:81>).  And I thought I'd found the 
> correct way to do the restriction by port number, by using Apache's 
> SSLRequire directive.  But when I enable that directive, SVN starts 
> throwing errors like:
> 
> svn: REPORT request failed on '/svn/ourrepo/!svn/vcc/default'
> svn: Not authorized to open root of edit operation
> 
> It seems that the SSLRequire directive is somehow blocking the SVN 
> client from connecting using HTTP REPORT.  But I'm quite puzzled as to 
> why that should be the case.  (Particularly because when I query the 
> repository on both SSL ports from a web browser all works as expected.)
> 
> Although googling turned up a number of pages referring to the same 
> error message, I didn't see any concrete solution.  Anyone have any 
> wisdom/workarounds on this problem?  Our Apache subversion.conf is 
> attached below.
> 
> Thanks,
> 
> DR
> 
> --
> 
> LoadModule dav_svn_module     modules/mod_dav_svn.so
> LoadModule authz_svn_module   modules/mod_authz_svn.so
> 
> LDAPSharedCacheSize 200000
> LDAPCacheEntries 1024
> LDAPCacheTTL 600
> LDAPOpCacheEntries 1024
> LDAPOpCacheTTL 600
> 
> <Location /svn>
>     DAV svn
>     SVNParentPath /var/svn
> 
>     # Require SSL connection for SVN access
>     SSLRequireSSL
>     # Require SSL over non-obvious port 81 for SVN access
> #   SSLRequire %{SERVER_PORT} == 81
> #   SSLRequire %{SERVER_PORT} eq "81"
> 
>     AuthType Basic
>     AuthBasicProvider ldap
>     AuthName "Subversion"
>     AuthLDAPURL 
> ldaps://ldap.ourdomain.com/ou=users,dc=ourdomain,dc=com?uid?one
>     AuthLDAPBindDN uid=subversion,ou=system,dc=ourdomain,dc=com
>     AuthLDAPBindPassword <one of our system ldap passwords>
>     AuthzLDAPAuthoritative off
>     Require valid-user
>     Require ldap-attribute employeeType=active
> </Location>
> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2419181
> 
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2420106

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].