Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 405 when using Propfind on some webdav servers #396

Closed
veni-vidi-code opened this issue May 18, 2024 · 6 comments
Closed

Error 405 when using Propfind on some webdav servers #396

veni-vidi-code opened this issue May 18, 2024 · 6 comments

Comments

@veni-vidi-code
Copy link

veni-vidi-code commented May 18, 2024

Hey,
when initialising the principal using get_principal using client.principal() returns 405 Not Allowed on some servers (e.g. openxchange). Interestingly enough when initialising it using client.principal(url=x) where xis the same url the client was initiated with it works. As the urlparameter is depreceated i think this should be adressed in some way by either undepreceating it or adding some sort of attempt to use the unaltered url as fallback

@veni-vidi-code
Copy link
Author

also see https://git.fsmpi.rwth-aachen.de/protokollsystem/proto3/-/issues/224 if you understand german

@tobixen
Copy link
Member

tobixen commented May 18, 2024

As I read the code, writingclient.principal(url=x) should be equivalent with writing Principal(client=client, url=x). The URL given there should be the URL to the principal (i.e. somehting like https://caldav.my.calendar/users/tobixen), and not the URL to he caldav server. (i.e. something like https://caldav.my.calendar/) When not giving an URL, the library will try to auto-detect the principal URL.

At some point I was optimistically assuming the auto-detection (through the PROPFIND method) would work on any calendar server, but I was wrong (it's not even a requirement in the RFC to support this method). Now, since OX gives 405 it most likely is one of the rare servers not supporting this.

One workaround here could be to fix the code to try doing a client.principal(url=client.url) if the server doesn't support PROPFIND.

Since I don't have OX and don't have time looking into OX itself, it would be very useful if you could provide me with a test account on OX that I could use to run the test code.

@tobixen
Copy link
Member

tobixen commented May 18, 2024

This may be related to #180

@veni-vidi-code
Copy link
Author

Hey,
sadly i do not have the permissions to create you a user on our server, i might talk to one of our admins within the next weeks though. Local hosting is also not an option, just for testing there licenses are to expensive. They do offer a test instance (The big green demo button on https://www.open-xchange.com/), but i can not figure out the caldav auth data there.

Some more information though: The problem is in principal.calender_home_set, more specific calendar_home_set_url = self.get_property(cdav.CalendarHomeSet()).
If the principal url is set to https://example.com/caldav/ (which gets port 443 added to it) it works as intended and returns /caldav/. If no url gets passed principal.url returns https://example.com:443/principals/users/someid (someid is just numbers) on which the propfind returns <html>\n<head><title>405 Not Allowed</title></head>\n<body bgcolor="white">\n<center><h1>405 Not Allowed</h1></center>\n<hr><center>nginx/versionnumber</center>\n</body>\n</html>\n.

@veni-vidi-code
Copy link
Author

I just noticed some more reasons that might be causing this whit openxchange. I will talk to our admins and reopen this ticket as needed

@veni-vidi-code veni-vidi-code closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
@tobixen
Copy link
Member

tobixen commented May 18, 2024

I could try to send an email to the OX team and ask if it's possible to use the demo environment for this purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants