{"action":"created","issue":{"url":"https://api.github.com/repos/nextcloud/server/issues/12890","repository_url":"https://api.github.com/repos/nextcloud/server","labels_url":"https://api.github.com/repos/nextcloud/server/issues/12890/labels{/name}","comments_url":"https://api.github.com/repos/nextcloud/server/issues/12890/comments","events_url":"https://api.github.com/repos/nextcloud/server/issues/12890/events","html_url":"https://github.com/nextcloud/server/issues/12890","id":388276880,"node_id":"MDU6SXNzdWUzODgyNzY4ODA=","number":12890,"title":"Internal Server Error at Login with OpenSSL 1.1.1a openssl_pkey_get_details expects parameter 1 to be resource, boolean given","user":{"login":"alexara","id":13819719,"node_id":"MDQ6VXNlcjEzODE5NzE5","avatar_url":"https://avatars0.githubusercontent.com/u/13819719?v=4","gravatar_id":"","url":"https://api.github.com/users/alexara","html_url":"https://github.com/alexara","followers_url":"https://api.github.com/users/alexara/followers","following_url":"https://api.github.com/users/alexara/following{/other_user}","gists_url":"https://api.github.com/users/alexara/gists{/gist_id}","starred_url":"https://api.github.com/users/alexara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexara/subscriptions","organizations_url":"https://api.github.com/users/alexara/orgs","repos_url":"https://api.github.com/users/alexara/repos","events_url":"https://api.github.com/users/alexara/events{/privacy}","received_events_url":"https://api.github.com/users/alexara/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-12-06T15:54:55Z","updated_at":"2018-12-06T17:03:16Z","closed_at":null,"author_association":"NONE","body":"### Summary\r\n\r\nI have a Nextcloud instance running on my VPS. With OpenSSL 1.1.1 compiled by source everything ran fine. Yesterday I upgraded OpenSSL 1.1.1 to 1.1.1a and encountered an internal server error, when I tried to login into Nextcloud.\r\n\r\nThe interesting part here is the following error message:\r\n\r\n`\r\n\"Exception\":\"TypeError\",\"Message\":\"openssl_pkey_get_details() expects parameter 1 to be resource, boolean given\",\"Code\":0,\"Trace\":[{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Authentication\\/Token\\/PublicKeyTokenProvider.php\",\"line\":301,\"function\":\"openssl_pkey_get_details\",\"args\":[false]\r\n`\r\n\r\n**I first reported this bug at the OpenSSL issue page**: https://github.com/openssl/openssl/issues/7837\r\n\r\nHere's what @mattcaswell said:\r\n> The error message suggests that the caller of the PHP function (presumably Nextcloud) is not behaving correctly by passing an invalid value as a parameter. So that suggests a bug in the PHP function caller (presumably Nextcloud?).\r\n> \r\n> Most likely what has happened is that the upgrade to 1.1.1a has suddenly caused some OpenSSL function call to behave differently in some way which has had a knock on impact in Nextcloud - thus triggering the Nextcloud bug and causing it to make the openssl_pkey_new_error function call with an invalid value.\r\n> \r\n> What the reason for the change in OpenSSL behaviour is, is unclear. It could be an intended change in behaviour (e.g. due to a bug fix), or it could be accidental (i.e. a newly introduced bug). **Either way the next step would be to isolate the bug in Nextcloud and get that fixed.** That should also identify what the underlying change in OpenSSL behaviour was that triggered it.\r\n\r\n(Highlighting by me)\r\n\r\n\r\n### Steps to reproduce\r\n1. Install Nextcloud 14.1\r\n2. Install OpenSSL 1.1.1a + PHP 7.2.10\r\n3. Try to login with a valid user\r\n\r\n### Expected behaviour\r\nLogin without any error. :)\r\n\r\n### Actual behaviour\r\nAn error occurs making it impossible to login:\r\n```\r\nInternal Server Error\r\nThe Server could not complete the request.\r\n```\r\n\r\n### Server configuration\r\n\r\n**Operating system**: Ubuntu 18.04.1\r\n\r\n**Web server:** Nginx 1.15.7 + OpenSSL 1.1.1a (compiled by source)\r\n\r\n**Database:** mariadb  Ver 15.1 Distrib 10.1.34-MariaDB \r\n\r\n**PHP version:** PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02)\r\n\r\n**Nextcloud version:** 14.1\r\n\r\n**Updated from an older Nextcloud/ownCloud or fresh install:** 14.0\r\n\r\n**Where did you install Nextcloud from:** zip-Package from Nextcloud.com\r\n\r\n**Signing status:** \r\n<details>\r\n<summary>Signing status</summary>\r\n\r\n```\r\nAll tests pased.\r\n```\r\n</details>\r\n\r\n**List of activated apps:**\r\n<details>\r\n<summary>App list</summary>\r\n\r\n```\r\nEnabled:\r\n  - accessibility: 1.0.1\r\n  - activity: 2.7.0\r\n  - bookmarks: 0.14.2\r\n  - calendar: 1.6.4\r\n  - checksum: 0.4.1\r\n  - cloud_federation_api: 0.0.1\r\n  - comments: 1.4.0\r\n  - contacts: 2.1.8\r\n  - dav: 1.6.0\r\n  - event_update_notification: 0.3.1\r\n  - federatedfilesharing: 1.4.0\r\n  - federation: 1.4.0\r\n  - files: 1.9.0\r\n  - files_pdfviewer: 1.3.2\r\n  - files_sharing: 1.6.2\r\n  - files_texteditor: 2.6.0\r\n  - files_trashbin: 1.4.1\r\n  - files_versions: 1.7.1\r\n  - files_videoplayer: 1.3.0\r\n  - firstrunwizard: 2.3.0\r\n  - gallery: 18.1.0\r\n  - gpxmotion: 0.0.7\r\n  - gpxpod: 2.3.2\r\n  - logreader: 2.0.0\r\n  - lookup_server_connector: 1.2.0\r\n  - nextcloud_announcements: 1.3.0\r\n  - notes: 2.5.1\r\n  - notifications: 2.2.1\r\n  - oauth2: 1.2.1\r\n  - onlyoffice: 2.1.0\r\n  - password_policy: 1.4.0\r\n  - previewgenerator: 2.0.0\r\n  - provisioning_api: 1.4.0\r\n  - serverinfo: 1.4.0\r\n  - sharebymail: 1.4.0\r\n  - spreed: 4.0.1\r\n  - support: 1.0.0\r\n  - survey_client: 1.2.0\r\n  - systemtags: 1.4.0\r\n  - tasks: 0.9.8\r\n  - theming: 1.5.0\r\n  - twofactor_backupcodes: 1.3.1\r\n  - updatenotification: 1.4.1\r\n  - workflowengine: 1.4.0\r\nDisabled:\r\n  - admin_audit\r\n  - bruteforcesettings\r\n  - encryption\r\n  - files_external\r\n  - user_external\r\n  - user_ldap\r\n```\r\n</details>\r\n\r\n**Nextcloud configuration:**\r\n<details>\r\n<summary>Config report</summary>\r\n\r\n```\r\n{\r\n    \"system\": {\r\n        \"instanceid\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"passwordsalt\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"secret\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"trusted_domains\": [\r\n            \"domain.tld\"\r\n        ],\r\n        \"datadirectory\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"overwrite.cli.url\": \"https:\\/\\/path\\/nextcloud\",\r\n        \"dbtype\": \"mysql\",\r\n        \"version\": \"14.0.4.2\",\r\n        \"dbname\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"dbhost\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"dbport\": \"\",\r\n        \"dbtableprefix\": \"oc_\",\r\n        \"dbuser\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"dbpassword\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"memcache.local\": \"\\\\OC\\\\Memcache\\\\APCu\",\r\n        \"installed\": true,\r\n        \"maintenance\": false,\r\n        \"theme\": \"\",\r\n        \"loglevel\": 0,\r\n        \"updater.release.channel\": \"stable\"\r\n    }\r\n}\r\n\r\n```\r\n</details>\r\n\r\n**Are you using external storage, if yes which one:** local\r\n\r\n**Are you using encryption:** no\r\n\r\n**Are you using an external user-backend, if yes which one:** no\r\n\r\n### Client configuration\r\n**Browser:** FireFox 63.0.3\r\n\r\n**Operating system:** Manjaro 18\r\n\r\n### Logs\r\n\r\n#### Nextcloud log (data/nextcloud.log)\r\n```\r\n{\"reqId\":\"a0FfZr6Dfd2Q7wFQ5t4Q\",\"level\":3,\"time\":\"2018-12-05T23:22:41+00:00\",\"remoteAddr\":\"XXX.XXX.XXX.XXX\",\"user\":\"USER1\",\"app\":\"index\",\"method\":\"POST\",\"url\":\"\\/nextcloud\\/login?redirect_url=\\/nextcloud\\/apps\\/files\\/\",\"message\":{\"Exception\":\"TypeError\",\"Message\":\"openssl_pkey_get_details() expects parameter 1 to be resource, boolean given\",\"Code\":0,\"Trace\":[{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Authentication\\/Token\\/PublicKeyTokenProvider.php\",\"line\":301,\"function\":\"openssl_pkey_get_details\",\"args\":[false]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Authentication\\/Token\\/PublicKeyTokenProvider.php\",\"line\":70,\"function\":\"newToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\PublicKeyTokenProvider\",\"type\":\"->\",\"args\":[\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Authentication\\/Token\\/Manager.php\",\"line\":69,\"function\":\"generateToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\PublicKeyTokenProvider\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/User\\/Session.php\",\"line\":641,\"function\":\"generateToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\Manager\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/core\\/Controller\\/LoginController.php\",\"line\":322,\"function\":\"createSessionToken\",\"class\":\"OC\\\\User\\\\Session\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php\",\"line\":166,\"function\":\"tryLogin\",\"class\":\"OC\\\\Core\\\\Controller\\\\LoginController\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php\",\"line\":99,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Core\\\\Controller\\\\LoginController\"},\"tryLogin\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/AppFramework\\/App.php\",\"line\":118,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Core\\\\Controller\\\\LoginController\"},\"tryLogin\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/AppFramework\\/Routing\\/RouteActionHandler.php\",\"line\":47,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OC\\\\Core\\\\Controller\\\\LoginController\",\"tryLogin\",{\"__class__\":\"OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer\"},{\"_route\":\"core.login.tryLogin\"}]},{\"function\":\"__invoke\",\"class\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\",\"type\":\"->\",\"args\":[{\"_route\":\"core.login.tryLogin\"}]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Route\\/Router.php\",\"line\":297,\"function\":\"call_user_func\",\"args\":[{\"__class__\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\"},{\"_route\":\"core.login.tryLogin\"}]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/base.php\",\"line\":987,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"\\/login\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/index.php\",\"line\":42,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\",\"args\":[]}],\"File\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Authentication\\/Token\\/PublicKeyTokenProvider.php\",\"Line\":301,\"CustomMessage\":\"--\"},\"userAgent\":\"XXX}\r\n{\"reqId\":\"qwr19jSFwzwTGTaBeVGY\",\"level\":3,\"time\":\"2018-12-05T23:25:33+00:00\",\"remoteAddr\":\"XXX.XXX.XXX.XXX\",\"user\":\"USER1\",\"app\":\"PHP\",\"method\":\"POST\",\"url\":\"\\/nextcloud\\/login?redirect_url=\\/nextcloud\\/apps\\/files\\/\",\"message\":\"openssl_pkey_export(): cannot get key from parameter 1 at \\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Authentication\\/Token\\/PublicKeyTokenProvider.php#298\",\"userAgent\":\"XXX}\r\n{\"reqId\":\"qwr19jSFwzwTGTaBeVGY\",\"level\":3,\"time\":\"2018-12-05T23:25:33+00:00\",\"remoteAddr\":\"XXX.XXX.XXX.XXX\",\"user\":\"USER1\",\"app\":\"index\",\"method\":\"POST\",\"url\":\"\\/nextcloud\\/login?redirect_url=\\/nextcloud\\/apps\\/files\\/\",\"message\":{\"Exception\":\"TypeError\",\"Message\":\"openssl_pkey_get_details() expects parameter 1 to be resource, boolean given\",\"Code\":0,\"Trace\":[{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Authentication\\/Token\\/PublicKeyTokenProvider.php\",\"line\":301,\"function\":\"openssl_pkey_get_details\",\"args\":[false]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Authentication\\/Token\\/PublicKeyTokenProvider.php\",\"line\":70,\"function\":\"newToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\PublicKeyTokenProvider\",\"type\":\"->\",\"args\":[\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Authentication\\/Token\\/Manager.php\",\"line\":69,\"function\":\"generateToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\PublicKeyTokenProvider\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/User\\/Session.php\",\"line\":641,\"function\":\"generateToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\Manager\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/core\\/Controller\\/LoginController.php\",\"line\":322,\"function\":\"createSessionToken\",\"class\":\"OC\\\\User\\\\Session\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php\",\"line\":166,\"function\":\"tryLogin\",\"class\":\"OC\\\\Core\\\\Controller\\\\LoginController\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php\",\"line\":99,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Core\\\\Controller\\\\LoginController\"},\"tryLogin\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/AppFramework\\/App.php\",\"line\":118,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Core\\\\Controller\\\\LoginController\"},\"tryLogin\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/AppFramework\\/Routing\\/RouteActionHandler.php\",\"line\":47,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OC\\\\Core\\\\Controller\\\\LoginController\",\"tryLogin\",{\"__class__\":\"OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer\"},{\"_route\":\"core.login.tryLogin\"}]},{\"function\":\"__invoke\",\"class\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\",\"type\":\"->\",\"args\":[{\"_route\":\"core.login.tryLogin\"}]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Route\\/Router.php\",\"line\":297,\"function\":\"call_user_func\",\"args\":[{\"__class__\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\"},{\"_route\":\"core.login.tryLogin\"}]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/base.php\",\"line\":987,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"\\/login\"]},{\"file\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/index.php\",\"line\":42,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\",\"args\":[]}],\"File\":\"\\/var\\/www\\/domain.tld\\/nextcloud\\/lib\\/private\\/Authentication\\/Token\\/PublicKeyTokenProvider.php\",\"Line\":301,\"CustomMessage\":\"--\"},\"userAgent\":\"XXX}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/nextcloud/server/issues/comments/444948484","html_url":"https://github.com/nextcloud/server/issues/12890#issuecomment-444948484","issue_url":"https://api.github.com/repos/nextcloud/server/issues/12890","id":444948484,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDk0ODQ4NA==","user":{"login":"danielkesselberg","id":3902676,"node_id":"MDQ6VXNlcjM5MDI2NzY=","avatar_url":"https://avatars3.githubusercontent.com/u/3902676?v=4","gravatar_id":"","url":"https://api.github.com/users/danielkesselberg","html_url":"https://github.com/danielkesselberg","followers_url":"https://api.github.com/users/danielkesselberg/followers","following_url":"https://api.github.com/users/danielkesselberg/following{/other_user}","gists_url":"https://api.github.com/users/danielkesselberg/gists{/gist_id}","starred_url":"https://api.github.com/users/danielkesselberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielkesselberg/subscriptions","organizations_url":"https://api.github.com/users/danielkesselberg/orgs","repos_url":"https://api.github.com/users/danielkesselberg/repos","events_url":"https://api.github.com/users/danielkesselberg/events{/privacy}","received_events_url":"https://api.github.com/users/danielkesselberg/received_events","type":"User","site_admin":false},"created_at":"2018-12-06T17:03:16Z","updated_at":"2018-12-06T17:03:16Z","author_association":"CONTRIBUTOR","body":"https://github.com/nextcloud/server/issues/11227#issuecomment-421625604 use strace to look whats going on. Could you try this?"}}
{"actor":{"display_login":"danielkesselberg"}}