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

SSL connection doesn't happen when using login credentials with webdav external storage. #22016

Closed
SergioBertolinSG opened this issue Jan 29, 2016 · 18 comments · Fixed by #22636

Comments

@SergioBertolinSG
Copy link
Contributor

Steps to reproduce

  1. Enable external storage.
  2. Mount webdav external storage using login credentials stored on database, using https.
  3. Login using user which can access that server.
  4. See files view.

Expected behaviour

Folder is correctly mounted.

Actual behaviour

Folder is not mounted.

Tested with accepted certificates and self-signed. Both fails to connect (But doesn't shows red square).

Server configuration

Operating system:
Ubuntu 14.04

Web server:
Apache

Database:
MySQL

PHP version:
5.5.9

ownCloud version: (see ownCloud admin page)
Master branch
{"installed":true,"maintenance":false,"version":"9.0.0.6","versionstring":"9.0 pre alpha","edition":""}

Updated from an older ownCloud or fresh install:
Fresh

The content of config/config.php:


Are you using external storage, if yes which one: local/smb/sftp/...
Yes webdav.

Are you using encryption:
No

Logs

{"reqId":"Gw6Y2yfpFYOsmY6Y\/ci3","remoteAddr":"HIDED_IP","app":"files_external","message":"Exception: {\"Exception\":\"OCP\\\\Files\\\\StorageNotAvailableException\",\"Message\":\"Sabre\\\\HTTP\\\\ClientException: Empty reply from server\",\"Code\":0,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/dav.php(555): OC\\\\Files\\\\Storage\\\\DAV->convertException(Object(Sabre\\\\HTTP\\\\ClientException), '')\\n#1 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/common.php(435): OC\\\\Files\\\\Storage\\\\DAV->stat('')\\n#2 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/config.php(232): OC\\\\Files\\\\Storage\\\\Common->test(false)\\n#3 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/storagescontroller.php(244): OC_Mount_Config::getBackendStatus('\\\\OC\\\\Files\\\\Stora...', Array, false)\\n#4 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/userglobalstoragescontroller.php(112): OCA\\\\Files_External\\\\Controller\\\\StoragesController->updateStorageStatus(Object(OCA\\\\Files_external\\\\Lib\\\\StorageConfig))\\n#5 [internal function]: OCA\\\\Files_External\\\\Controller\\\\UserGlobalStoragesController->show(7)\\n#6 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(159): call_user_func_array(Array, Array)\\n#7 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OCA\\\\Files_External\\\\Controller\\\\UserGlobalStoragesController), 'show')\\n#8 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/app.php(110): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Files_External\\\\Controller\\\\UserGlobalStoragesController), 'show')\\n#9 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/routing\\\/routeactionhandler.php(45): OC\\\\AppFramework\\\\App::main('UserGlobalStora...', 'show', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#10 [internal function]: OC\\\\AppFramework\\\\routing\\\\RouteActionHandler->__invoke(Array)\\n#11 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(273): call_user_func(Object(OC\\\\AppFramework\\\\routing\\\\RouteActionHandler), Array)\\n#12 \\\/opt\\\/owncloud\\\/lib\\\/base.php(865): OC\\\\Route\\\\Router->match('\\\/apps\\\/files_ext...')\\n#13 \\\/opt\\\/owncloud\\\/index.php(39): OC::handleRequest()\\n#14 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/dav.php\",\"Line\":795}","level":3,"time":"2016-01-29T12:31:42+00:00"}

Client configuration

browser
Chrome

@SergioBertolinSG
Copy link
Contributor Author

cc @icewind1991

@SergioBertolinSG
Copy link
Contributor Author

Happening the same using owncloud as external storage.

@PVince81
Copy link
Contributor

I guess you probably used the SSL checkbox, I just saw this: #21978 (comment)

The PR that fixes validation was fixed, can you try again with 9.0beta1 ?

@PVince81
Copy link
Contributor

Any update, is this still happening ?

@SergioBertolinSG
Copy link
Contributor Author

Yes, now behaviour is a little different, red background appears, clicking on it appears a pop up saying:

There was an error with message: Sabre\HTTP\ClientException: Empty reply from server. Do you want to review mount point config in admin settings page?

Logs:

{"reqId":"+ql7ujvXn\/AgCqHiGvZr","remoteAddr":"IP","app":"files_external","message":"Empty reply from server","level":3,"time":"2016-02-17T12:05:13+00:00"}
{"reqId":"+ql7ujvXn\/AgCqHiGvZr","remoteAddr":"IP","app":"files_external","message":"Exception: {\"Exception\":\"OCP\\\\Files\\\\StorageNotAvailableException\",\"Message\":\"Sabre\\\\HTTP\\\\ClientException: Empty reply from server\",\"Code\":1,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/dav.php(555): OC\\\\Files\\\\Storage\\\\DAV->convertException(Object(Sabre\\\\HTTP\\\\ClientException), '')\\n#1 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/common.php(429): OC\\\\Files\\\\Storage\\\\DAV->stat('')\\n#2 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/config.php(232): OC\\\\Files\\\\Storage\\\\Common->test(false)\\n#3 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/storagescontroller.php(255): OC_Mount_Config::getBackendStatus('\\\\OC\\\\Files\\\\Stora...', Array, false)\\n#4 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/storagescontroller.php(302): OCA\\\\Files_External\\\\Controller\\\\StoragesController->updateStorageStatus(Object(OCA\\\\Files_external\\\\Lib\\\\StorageConfig))\\n#5 [internal function]: OCA\\\\Files_External\\\\Controller\\\\StoragesController->show(1)\\n#6 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(159): call_user_func_array(Array, Array)\\n#7 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OCA\\\\Files_External\\\\Controller\\\\GlobalStoragesController), 'show')\\n#8 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/app.php(110): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Files_External\\\\Controller\\\\GlobalStoragesController), 'show')\\n#9 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/routing\\\/routeactionhandler.php(45): OC\\\\AppFramework\\\\App::main('GlobalStoragesC...', 'show', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#10 [internal function]: OC\\\\AppFramework\\\\routing\\\\RouteActionHandler->__invoke(Array)\\n#11 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(273): call_user_func(Object(OC\\\\AppFramework\\\\routing\\\\RouteActionHandler), Array)\\n#12 \\\/opt\\\/owncloud\\\/lib\\\/base.php(856): OC\\\\Route\\\\Router->match('\\\/apps\\\/files_ext...')\\n#13 \\\/opt\\\/owncloud\\\/index.php(39): OC::handleRequest()\\n#14 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/dav.php\",\"Line\":795}","level":3,"time":"2016-02-17T12:05:13+00:00"}
{"reqId":"vgeh7qOh73RwbOJj+wsk","remoteAddr":"IP","app":"files_external","message":"Empty reply from server","level":3,"time":"2016-02-17T12:05:15+00:00"}
{"reqId":"vgeh7qOh73RwbOJj+wsk","remoteAddr":"IP","app":"files_external","message":"Exception: {\"Exception\":\"OCP\\\\Files\\\\StorageNotAvailableException\",\"Message\":\"Sabre\\\\HTTP\\\\ClientException: Empty reply from server\",\"Code\":1,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/dav.php(555): OC\\\\Files\\\\Storage\\\\DAV->convertException(Object(Sabre\\\\HTTP\\\\ClientException), '')\\n#1 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/common.php(429): OC\\\\Files\\\\Storage\\\\DAV->stat('')\\n#2 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/config.php(232): OC\\\\Files\\\\Storage\\\\Common->test(false)\\n#3 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/storagescontroller.php(255): OC_Mount_Config::getBackendStatus('\\\\OC\\\\Files\\\\Stora...', Array, false)\\n#4 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/globalstoragescontroller.php(178): OCA\\\\Files_External\\\\Controller\\\\StoragesController->updateStorageStatus(Object(OCA\\\\Files_external\\\\Lib\\\\StorageConfig))\\n#5 [internal function]: OCA\\\\Files_External\\\\Controller\\\\GlobalStoragesController->update(1, 'WebDAV', 'dav', 'password::sessi...', Array, Array, Array, Array, 100)\\n#6 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(159): call_user_func_array(Array, Array)\\n#7 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OCA\\\\Files_External\\\\Controller\\\\GlobalStoragesController), 'update')\\n#8 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/app.php(110): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Files_External\\\\Controller\\\\GlobalStoragesController), 'update')\\n#9 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/routing\\\/routeactionhandler.php(45): OC\\\\AppFramework\\\\App::main('GlobalStoragesC...', 'update', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#10 [internal function]: OC\\\\AppFramework\\\\routing\\\\RouteActionHandler->__invoke(Array)\\n#11 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(273): call_user_func(Object(OC\\\\AppFramework\\\\routing\\\\RouteActionHandler), Array)\\n#12 \\\/opt\\\/owncloud\\\/lib\\\/base.php(856): OC\\\\Route\\\\Router->match('\\\/apps\\\/files_ext...')\\n#13 \\\/opt\\\/owncloud\\\/index.php(39): OC::handleRequest()\\n#14 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/dav.php\",\"Line\":795}","level":3,"time":"2016-02-17T12:05:15+00:00"}

Tested with daily master {"installed":true,"maintenance":false,"version":"9.0.0.11","versionstring":"9.0 beta 1","edition":""}

The https checkbox appears unchecked after going back to the admin page.

@PVince81
Copy link
Contributor

Are the login credentials valid for this ext storage ? If not, then that dialog would appear.

@PVince81
Copy link
Contributor

also, probably unrelated to SSL ?

@SergioBertolinSG
Copy link
Contributor Author

Are the login credentials valid for this ext storage ?

Yes, they are valid, but still doesn't connect.

@SergioBertolinSG
Copy link
Contributor Author

also, probably unrelated to SSL ?

It is related, mounting it without SSL works fine.

@PVince81
Copy link
Contributor

Ok, thanks for the info. Then there is indeed a bug with SSL + login credentials.

@PVince81
Copy link
Contributor

@SergioBertolinSG did you manually add "https" in the host field or did you just use the format "host/owncloud/remote.php/webdav" ?

@LukasReschke
Copy link
Member

I stumbled upon the bug while debugging https://github.com/owncloud/core/issues/22605 … this has a security impact as it disables the whole SSL verification 🙈

LukasReschke added a commit that referenced this issue Feb 24, 2016
The current logic is checking whether:

1. The returned value is a boolen
2. The returned value is a string and then matches for "true"

Since the config is now written to the database the data is now a string with the value "1" if HTTPS is set to true. Effectively this option was thus always disabled at the moment, falling back to plain HTTP.

This change casts the data to a boolean if it is defined as boolean.

Fixes #22605
Fixes #22016
@SergioBertolinSG
Copy link
Contributor Author

Still happening on 9.0.0rc1.

@PVince81
Copy link
Contributor

PVince81 commented Mar 2, 2016

@SergioBertolinSG please work with @LukasReschke so he get reproduce the issue.

@LukasReschke
Copy link
Member

Yes. Proper reproduction steps are required here. Server host etc. everything.

@SergioBertolinSG
Copy link
Contributor Author

Like the original steps,just more detailed

serverA is a oC 9.0.0rc1
serverB is a oC 9.0.0rc1 with trustworthy certificate
both servers have admin user with same password.

  1. Enable external storage app in serverA.
  2. Mount serverB as webdav external storage using login credentials stored on database in serverA, use https and enable the checkbox. (Happens also with stored in session).
  3. Login in serverA using admin.
  4. See files view. Check webdav mountpoint folder.

@SergioBertolinSG
Copy link
Contributor Author

OK, tested with a webdav server different than owncloud, using ssl. Working fine in 9.0rc1.

@lock
Copy link

lock bot commented Aug 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants