Can't create account with IPv6 address

  • Hello there,

    I’m using DAVdroid 1.2 and tried to create a new DAVdroid account with a IPv6 address.

    After entering the IP I got the following error message:
    Expected a closing square bracket for IPv6 address at index 0: [2a02

    The address is specified as

    CatLog gave Warnings at
    at.bitfire.davdroid.ui.setup.LoginCredentialsFragment $1.onClick(

    I’m using Android Version 6.0.1.
    I hope you can help me.

  • developer

    And you’re sure that the closing square bracket is correctly entered? Did you try with slash at the end?

  • @rfc2822 Yes, no matter what I type everytime the closing square bracket is expected before the first colon.
    It seems as if the first colon is recognized as the end of the host.

    I also tried it with a slash at the end.

  • developer

    Maybe problems with the IDN conversion …

  • developer

    Turns out that Android’s Uri class doesn’t understand IPv6 literals. It returns Error parsing port string. java.lang.NumberFormatException: Invalid int: "2::3]" when calling it for http://[2a02:2::3]/test because it interprets everything before the first : as host name, and everything else as port number (quality crafted by Google).

    Seems like we have to wrap the the check into a real Java URI.

  • developer

    IPv6 literals should work with DAVx⁵ 2.4. Can you confirm that?

  • @rfc2822 I’ve just tested this with DAVx5 3.3.8-ose and IPv6 literals don’t work.

    I get:

    Illegal character in authority at index 7: http://[2001:DB8::23]:5232
  • developer

    @gsauthof Works here with this URI. Which Android version?

  • @rfc2822 Android 11 on a Pixel 3a.

    Don’t know if this makes a difference, I installed DAVx5 from the f-droid store.

    I entered the URL when starting DAVx5 for the first time, i.e. when stepping through the initial setup dialog, i.e. I entered the URL, username and password in separate edit fields. (i.e. the fields you get when you select the 2nd radio button in that step, IIRC)

  • @gsauthof Ok, I re-tested this and this was a copy’n’paste error on my side: Since the actual IPv6 address is a bit longer I used a qr-code to copy it to the phone. That QR-Code content was accidentally terminated with a newline character which was also pasted (before the ] character).

    When removing this extra character the error is gone.

    So the error message ‘Illegal character in authority at index 7’ misled me, because if you start at the beginning and assume 0-based indexing, the index 7 references the [ character. Looks like the index refers to the 8th 16-bit group in the IPv6 address then.

Similar topics

  • 2
  • 4
  • 1