alexbakker / webdav-provider

An Android app that can expose WebDAV storage to other apps through Android's Storage Access Framework (SAF)
https://rocli.dev/webdav
GNU General Public License v3.0
121 stars 30 forks source link

Adding account - testing credentials on incorrect port (80 instead of 443) #15

Closed moneytoo closed 2 years ago

moneytoo commented 2 years ago

I'm adding a new account with URL like this: https://my.example.com/webdav. However after tapping Save, I get an error about SocketTimeoutException - failed connection to port 80. This my server doesn't have port 80 open at all. Using https://my.example.com:443/webdav doesn't help.

alexbakker commented 2 years ago

Huh, that sounds odd. The only reason (that I can think of right now) why it would try to connect to port 80 somewhere, is if https://my.example.com/webdav redirects to some http:// URL.

Does this URL work with other WebDAV clients? Which WebDAV server are you using?

moneytoo commented 2 years ago

My server setup is mentioned here: https://github.com/alexbakker/webdav-provider/issues/7#issuecomment-897093279

I mostly use Solid Explorer on Android but I also successfully used other file managers on Android (as well as WinSCP and NetDrive on desktop).

When I enter the same config to Solid Explorer, it produces this request:

"PROPFIND /webdav/ HTTP/1.1" 401 179 "-" "SolidExplorer/2.0" "-"

While with webdav-provider I get:

"PROPFIND /webdav HTTP/2.0" 301 235 "-" "okhttp/4.9.1" "-"

So I changed the url in account setup to https://my.example.com/webdav/ but I still get the same PROPFIND /webdav

When degugging, the path stored in java.nio.file.Path (rootPath) is in propFind converted to String without trailing slash. When I modify that, it works.

moneytoo commented 2 years ago

My nginx proxy was missing proxy_redirect directive. 😳 Everything works after adding that.