-
Notifications
You must be signed in to change notification settings - Fork 31
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
Java.Net.ProtocolException when using AndroidClientHandler: PROPFIND (and others) unsupported #59
Comments
After some consideration I decided to not include a workaround into the library since it's a rare case and it should be possible to implement a workaround on the client (hopefully Thanks for bringing this up though, this could be helpful for people who encountered the same problem. |
@tipa @skazantsev Is there any sample code on how to fix this? |
I found a solution to the problem. It is enough to add the HttpClientHandler to the client. I don't know why it works.
|
It works because the |
It would be nice to write about this in the library manual. Since this is not an obvious thing. It took me all day to find a solution. This could save other developers time. |
Hi everybody, I had to go the opposite way, from HttpClientHandler to AndroidClientHandler because it will keep giving Authentication failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED with the Let's Encrypt certificates past 09/30. Using the Android handler enables the use of TLS 1.2 instead of 1.0. So, after the expiration, it will be common to find this error in the wild. I'm still stuck trying to overcome the Expected one of [OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, PATCH] but was PROPFIND error. What would be the suggested override for PROPFIND using X-HTTP-Method-Override? |
I am in the same situation, the AndroidClientHandler is not working with PROPFIND and the HttpClientHandler is not working with some certificates. So it is not possible to use this library to access some servers. |
@pp111 it is possible, but you need to use |
If I use HttpClientHandler I get the exception Authentication failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED The certificate is fine, but needs TLS 1.2 which seems to be not supported with HttpClientHandler on Android (on Windows it works fine). Using AndroidClientHandler the certificate validation works fine, but it fails because of the PROPFIND issue. So, if I am not missing something, none of the two handlers are working with TLS1.2 servers on Android. |
You can ignore that certificate check like this:
|
Yes, I think this is the only option although it might be potentially unsafe. |
The |
can you post here an step by step how-to make work with android ? I try all things and cannot resolve the propfind exception... thanks |
The issue has also been discussed here |
@skazantsev I am still forced to use a |
@tipa does the |
Yes, SocketsHttpHandler generally still works for me |
Interesting, I'm connecting to a nextcloud instance, with a app-password scheme so I need to set the auth via headers as follow
...pherhaps is somehow related to this difference. |
@tipa may I ask what kind of Android version have you tested? |
I am using it in production, with basically all Android versions |
Okay, thanks. |
I am using this library in my multi-platform Xamarin app and attempt to use the native HttpClientHandler on each platform (Windows -> HttpClientHandler, iOS -> NSUrlSessionHandler, Android -> AndroidClientHandler).
In the case of Android:
Unfortunately, this causes the following exception when using the
WebDavClient
:Java.Net.ProtocolException: Expected one of [OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, PATCH] but was PROPFIND
A few possible solutions/workarounds are mentioned here: https://stackoverflow.com/questions/25163131/httpurlconnection-invalid-http-method-patch (X-HTTP-Method-Override, Reflection, ...)
I understand that this is not a bug in your library, but maybe you are interested in adding a workaround anyways...
The text was updated successfully, but these errors were encountered: