Character ~ prevents connection

  • Hello.

    I want to create an account with a root URL having the following format:

    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: ->

    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/ at ligne 50 to remove the ~ option.
    Then follow

    With this technique you can use ovh mutu ssl system via : and (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.

Similar topics

  • 6
  • 13
  • 7