Character ~ prevents connection



  • Hello.

    I want to create an account with a root URL having the following format:
    https://ssl3.ovh.net/~account/path/remote.php/carddav/

    I get the error "Missing capabilites. Neither Carddav or Caldav collection". But using curl on my computer, I can fetch what seems to be a valid WebDAV response. So, looking to the logcat output, I found:

    W/davdroid.URIUtils(19821): Tried to repair invalid URL/URL path: https://ssl3.ovh.net/~soulayro/mist/remote.php/carddav/ -> https://ssl3.ovh.net/~soulayro/mist/remote.php/carddav/

    The character ~ is valid and should not be mangled by davdroid.


  • developer

    RFC 1738 page 2:

    »Other characters are unsafe because gateways and other transport agents are known to sometimes modify such characters. These characters are "{", "}", "|", "", "^", "~", "[", "]", and "`".

    All unsafe characters must always be encoded within a URL.«

    Please see also Why tilde (~) should not be used in Web addresses (URLs).

    In any case (i.e. whether you agree or you don't), your Web/DAV server should understand tildes encoded as %7e. What server do you use?



  • Thanks for clarifying. I guess I have no other choice than having an argue with my provider about this format, and why it doesn't understand when the tilde is escaped.
    I will close this ticket soon if I do not find a reason to bother you more on the subject. ;)


  • developer

    Yes, the real problem is that it doesn't understand the escaped tilde.

    While I could change DAVdroid so that it accepts and keeps ~, I'm sure that there will be other servers that won't accept ~ because it's not allowed etc. I have had many problems with special chars, so I have decided to encode received invalid URLs correctly whenever possible because all servers (whether they like or don't like the invalid URLs) should be able to deal with the encoded version (a wrong guess, like it seems).



  • You can compile DAVDroid manually to accept '~' !
    Edit the file src/at/bitfire/davdroid/URIUtils.java at ligne 50 to remove the ~ option.
    Then follow https://github.com/rfc2822/davdroid/wiki/Compiling

    With this technique you can use ovh mutu ssl system via : https://sslXX.ovh.net/~your-user/cloud/remote.php/carddav/ and https://sslXX.ovh.net/~your-user/cloud/remote.php/caldav/ (if you use a sub-domain, you can simply create a symlink in your www to your cloud directory.

    I hope this helps some of you...


  • developer

    You can compile DAVDroid manually to accept '~' !

    Please be aware that then other things may break. For instance, multi-responses to PROPFIND maybe won't be parsed correctly, resulting in unexpected behaviour.


Log in to reply
 

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.