Ssl initialization failed on android app

Nextcloud version (eg, 20.0.5): 26.0.1.1
Operating system and version (eg, Ubuntu 20.04): raspbian 11 bullseye
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.56 (Raspbian)
PHP version (eg, 7.4): PHP 8.1.18 (cli)

The issue you are facing:
I installed everything following a tutorial with a self signed cert on my raspberry pi with port forwarding from the router. i was able to connect with laptop, desktop, mobile browser and android app. i did get the initial warning from the browser, but that doesn’t really bother me. however, i was not able to link thunderbird with tbsync nor the DAVx5 app and this was its raison d’être. so, i thought maybe this was because of the lack of ssl. so i then followed a mishmash of tutorials and was able to get a domain with noip.com and a cert from letsencrypt.com and installed ducdns. after setting all that up i was able to bring up the nextcloud server using the domain name with no warnings on my laptop and was very proud of myself…until i tried accessing it on any other device. for some reason it connects no problem on my laptop, but the desktop, mobile browser and android app all have issues now. the android app says ‘ssl initializaiton failed’ and the other browsers say 'This site can’t be reached kenkloud.hopto.org unexpectedly closed the connection.
Try:

Checking the connection
ERR_CONNECTION_CLOSED’

I have no idea where to even start fixing this. My guess is something from the old config is confusing the new or is duplicate. Any help, even where to look, would be much appreciated. Thanks

Are you running a reverse proxy in front of Apache? I’m trying to figure out where the TLS (SSL) termination is happening. Another way to answer this might be, where did you setup the Lets Encrypt stuff?

What’s different about the laptop situation? Are all of these devices being tested from the same location and LAN or different places?

For what it’s worth, kenkloud.hopto.org does does not have a TLS/HTTPS server running on it (at least not on 443) and the page on port 80 is just the default Raspbian/Debian install one. If you’re running on non-default ports that may be expected, but otherwise that’s an issue.

I don’t think so. I’m not even sure what that is. I did initially attempt to set up the raspberry pi with with my VPN, but that made everything not work and so I disconnected it on the pi. The LE stuff is all installed on the pi. I’m not sure what’s different about the laptop, but I’d be happy to provide logs or reports about whatever might help you determine this, as long as you’re explicit about how to find. I am not a networking guy and this is all a bit over my head. Everything is being tested on the local network, although I want to be able to access from outside eventually. I have tried turning off wifi on the phone to see if outside the network makes a difference and it does not. I have modified the configs quite a bit trying to make it work and so i wouldn’t be surprised if I’ve completely messed things up. There shouldn’t be anything on ports other than 80 and 443. That’s how I initially set it up.

Alright. Let’s start with tracking down your Apache error log.

On Raspbian/Debian it’s likely: /var/log/apache2/error.log

There are a million ways to configure things. Fortunately there are a few more common approaches and tutorial writers are generally lazy or follow norms so if you followed a bunch of random tutorials we can likely reverse engineer it. hah

I’d also be interested in the contents of any files in: /etc/apache2/sites-enabled/ (they are the main config files for the domains you setup)

ken@raspberrypi:~ $ cat /var/log/apache2/error.log
[Fri May 12 00:00:14.659191 2023] [mpm_prefork:notice] [pid 10507] AH00163: Apache/2.4.56 (Raspbian) OpenSSL/1.1.1n configured – resuming normal operations
[Fri May 12 00:00:14.659373 2023] [core:notice] [pid 10507] AH00094: Command line: ‘/usr/sbin/apache2’
[Fri May 12 01:17:09.408113 2023] [mpm_prefork:notice] [pid 10507] AH00171: Graceful restart requested, doing restart
[Fri May 12 01:17:10.004123 2023] [mpm_prefork:notice] [pid 10507] AH00163: Apache/2.4.56 (Raspbian) OpenSSL/1.1.1n configured – resuming normal operations
[Fri May 12 01:17:10.004279 2023] [core:notice] [pid 10507] AH00094: Command line: ‘/usr/sbin/apache2’
[Fri May 12 01:40:56.194702 2023] [mpm_prefork:notice] [pid 10507] AH00170: caught SIGWINCH, shutting down gracefully
[Fri May 12 01:41:24.217685 2023] [mpm_prefork:notice] [pid 580] AH00163: Apache/2.4.56 (Raspbian) OpenSSL/1.1.1n configured – resuming normal operations
[Fri May 12 01:41:24.221975 2023] [core:notice] [pid 580] AH00094: Command line: ‘/usr/sbin/apache2’
[Fri May 12 09:00:24.163412 2023] [php:error] [pid 796] [client 159.203.5.121:43232] script ‘/var/www/html/upl.php’ not found or unable to stat
[Fri May 12 16:02:02.896960 2023] [php:error] [pid 795] [client 5.188.210.227:30418] script ‘/var/www/html/echo.php’ not found or unable to stat, referer: https://www.google.com/

there was a default-ssl.conf in here, but i disabled it thinking it was causing a conflict…

ken@raspberrypi:/etc/apache2/sites-enabled $ ll
total 8
drwxr-xr-x 2 root root 4096 May 12 01:16 ./
drwxr-xr-x 9 root root 4096 May 8 19:46 …/
lrwxrwxrwx 1 root root 50 May 8 03:13 nextcloud-le-ssl.conf → /etc/apache2/sites-available/nextcloud-le-ssl.conf

Post the contents of this file. Feel free to redact anything you feel is sensitive though there isn’t much that is in there IMO.

ken@raspberrypi:/etc/apache2/sites-enabled $ cat nextcloud-le-ssl.conf

<VirtualHost *:443>
DocumentRoot /var/www/nextcloud/
ServerName kenkloud.hopto.org

<Directory /var/www/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews

<IfModule mod_dav.c>
  Dav off
</IfModule>

SSLCertificateFile /etc/letsencrypt/live/kenkloud.hopto.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/kenkloud.hopto.org/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf

any more thoughts on this? im thinking about deleting everything and starting over, but it’s a shame because i know im close…