Don't access via https://

Hi.
I install Nextcloud on Apache2 and success start him via http://
But after configure https;//, when I try to log I get the message: “SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG”.


My config:
Apache have 2 sites - dav.mysyte.com (Nextcloud) and xxx.mysite.com
Content Nextcloud copy into /var/www/dav.mysite.com
Self-signed sertificate copy into /etc/apache2/ssl


000-default.conf:

 <VirtualHost *:80>
   DocumentRoot /var/www/default
 </VirtualHost>

default-ssl.conf:

  <IfModule mod_ssl.c>
    <VirtualHost *:443>
            DocumentRoot /var/www/default
            SSLEngine on
            SSLCertificateFile      /etc/apache2/ssl/dav.mysyte.com.pem
            SSLCertificateKeyFile /etc/apache2/ssl/dav.mysyte.com.key
            <FilesMatch "\.(cgi|shtml|phtml|php)$">
                            SSLOptions +StdEnvVars
            </FilesMatch>
            <Directory /usr/lib/cgi-bin>
                            SSLOptions +StdEnvVars
            </Directory>
    </VirtualHost>

dav.mysyte.com

<VirtualHost *:80>
   ServerName dav.mysite.com
</VirtualHost>
<VirtualHost *:443>
   ServerName dav.mysite.com
   DocumentRoot /var/www/dav.mysite.com
   Alias /nextcloud "/var/www/dav.mysite.com/"
   <IfModule mod_headers.c>
       Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
   </IfModule>
   <Directory /var/www/dav.mysite.com/>
       Options +FollowSymlinks
       AllowOverride All
     <IfModule mod_dav.c>
         Dav off
     </IfModule>
     SetEnv HOME /var/www/dav.mysite.com
     SetEnv HTTP_HOME /var/www/dav.mysite.com
 </Directory>

xxx.mysite.conf

<VirtualHost *:80>
  ServerName xxx.mysyte.com
  Redirect permanent / https://xxx.mysyte.com/
</VirtualHost>
<VirtualHost *:443>
  ServerName xxx.mysite.com
  DocumentRoot /var/www/xxx.mysite.com
  DirectoryIndex index.html index.php
 <IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
 </IfModule>
</VirtualHost>

When I turn off in “sites-enabled” domain with Nextcloud (dav.mysite.com) available and https://xxx.mysite.com and /var/www/default.
When I enable dav.mysite.com I get the error “SSL_ERROR_RX_RECORD_TOO_LONG” on all domain.

What could be the problem?

Use this:
default-ssl.conf:

  <VirtualHost _default_:443>
               DocumentRoot /var/www/default
                SSLEngine on
                  SSLCertificateFile      /etc/apache2/ssl/dav.mysyte.com.pem
                  SSLCertificateKeyFile /etc/apache2/ssl/dav.mysyte.com.key
                  <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                  SSLOptions +StdEnvVars
                  </FilesMatch>
                  <Directory /usr/lib/cgi-bin>
                                  SSLOptions +StdEnvVars
                  </Directory>
          </VirtualHost>

The use of this default-ssl.conf did not help.

Solved.
By default .conf files apache2 is 000-default.conf and default-ssl.conf.
I have created a dav.mysite.conf and xxx.mysite.conf.
But dav.mysite.conf is alphabetically before default-ssl.conf and are therefore processed before are processed default-ssl.conf. This leads to the specified in the error message.
I renamed the default-ssl.conf in 000-default-ssl.conf and it worked after restarting apache2.