FTPS with external storage fails

Nextcloud version (eg, 18.0.2): 19.0.0b2
Operating system and version (eg, Ubuntu 20.04): Shared Hosting (netcup) with Debian 9 as a base
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1): 7.4.3

If I try to connect to a FTP share on the same webhosting it works with FTP only. After checking the box to use FTPS which is supported by the webhoster (netcup with Plesk, see https://www.netcup-wiki.de/wiki/Plesk_Onyx_Panel_Webhosting#FTP-Zugang) the connection doesn’t work anymore.
Accessing from it via Nautilus from my local Ubuntu 20.04 works with FTPS.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Add netcup FTP share to external storage app
  2. Check “FTPS”
  3. Press “Save”

The output of your Nextcloud log in Admin > Logging:

[PHP] Error: stat(): stat failed for ftps://xxx:xxx@hosting123456.abcde.netcup.net/ at /var/www/vhosts/hosting123456.abcde.netcup.net/httpdocs/cloud.example.de/apps/files_external/lib/Lib/Storage/StreamWrapper.php#127

PUT /apps/files_external/globalstorages/1
from 79.140.180.162 by demo at 2020-05-19T15:46:31+00:00

[PHP] Error: stat(): Peer certificate CN=`*.netcup.net' did not match expected CN=`hosting123456.abcde.netcup.net' at /var/www/vhosts/hosting123456.abcde.netcup.net/httpdocs/cloud.example.de/apps/files_external/lib/Lib/Storage/StreamWrapper.php#127

PUT /apps/files_external/globalstorages/1
from 79.140.180.162 by demo at 2020-05-19T15:46:31+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

PASTE HERE
```php
<?php
$CONFIG = array (
  'instanceid' => 'cccccccccccccc',
  'passwordsalt' => '/6HHjcccccccccccccccccccccc93eJ',
  'secret' => 'LE8ccccccccccccccccccccccccccccccccccccYKSt6l2',
  'trusted_domains' =>
  array (
    0 => 'cloud.example.de',
  ),
  'datadirectory' => '/var/www/vhosts/hosting123456.abcde.netcup.net/httpdocs/cloud.example.de/data',
  'dbtype' => 'mysql',
  'version' => '19.0.0.3',
  'overwrite.cli.url' => 'https://cloud.example.de',
  'dbname' => 'k910xxxxx',
  'dbhost' => '10.35.xx.xxx',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'k91xxxxxx',
  'dbpassword' => 'xxxxxx!5i',
  'installed' => true,
  'htaccess.RewriteBase' => '/',
  'app_install_overwrite' =>
  array (
    0 => 'occweb',
    1 => 'issuetemplate',
    2 => 'onlyoffice',
    3 => 'documentserver_community',
    4 => 'spreed',
  ),
  'maintenance' => false,
  'updater.secret' => '$2y$10$2mxxxxxxxxxxxxxxxxxxxxTQkq',
);

Perhaps you can or must use the ftp-server with the correct certificate. I think it is the same ftp-server and your credentials works.

Find the ip-address:

nslookup hosting123456.abcde.netcup.net

and then find the name:
nslookup <ip-address-from-first-nslookup>

On linux-systems you can use the command “host”