Vielleicht hilft dir das weiter.
Ich habe allerdings ein richtiges Zertifikat.
/etc/apache2/vhosts.d/vhost-ssl.conf
<IfDefine SSL>
<IfDefine !NOSSL>
<VirtualHost _default_:443>
# General setup for the virtual host
DocumentRoot "/srv/www/htdocs"
ServerAdmin <email address>
ErrorLog /var/log/apache2/error_log
TransferLog /var/log/apache2/access_log
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
# You can use per vhost certificates if SNI is supported.
SSLCertificateFile /etc/apache2/ssl.crt/wrosiak.de-ca.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/wrosiak.de-ca.key
SSLCertificateChainFile /etc/apache2/ssl.crt/wrosiak.de-chain-ca.crt
# Per-Server Logging:
# The home of a custom SSL log file. Use this when you want a
# compact non-error SSL logfile on a virtual host basis.
CustomLog /var/log/apache2/ssl_request_log ssl_combined
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
</IfModule>
Protocols h2 h2c http/1.1
</VirtualHost>
</IfDefine>
</IfDefine>
###########
listen.conf
Listen 80
<IfDefine SSL>
<IfDefine !NOSSL>
<IfModule mod_ssl.c>
Listen 443
</IfModule>
</IfDefine>
</IfDefine>
####
/etc/apache2/conf.d/nextcloud.conf
Alias /nextcloud "/srv/www/htdocs/nextcloud/"
<Directory "/srv/www/htdocs/nextcloud">
Options +FollowSymLinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /srv/www/htdocs/nextcloud
SetEnv HTTP_HOME /srv/www/htdocs/nextcloud
</Directory>
<Directory "/srv/www/htdocs/nextcloud/data/">
# just in case if .htaccess gets disabled
Require all denied
</Directory>
Redirect 301 /ocm-provider/ /nextcloud/ocm-provider/
Redirect 301 /ocs-provider/ /nextcloud/ocs-provider/