Bug 2258121 - The mod_ssl provided configuration causes certificate issues if there is only one domain
Summary: The mod_ssl provided configuration causes certificate issues if there is only...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: 39
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Luboš Uhliarik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-01-12 19:11 UTC by Peter Boy
Modified: 2024-11-27 22:38 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-11-27 22:38:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Peter Boy 2024-01-12 19:11:37 UTC
The mod_ssl distribution provided configuration in ~/conf.d/mod_ssl.conf defines a (default) ssl virtual host named _default_. If you have only one domain which matches the server name, the ssl _default_ host is detected first and becomes the default ssl configuration and takes precedence over the user-created configuration.

The result is:

1. If you use a letsencrypt certbot generated certificate and configure it in your virtual host config file, a https request results in an invalid certificate complain, because the mod_ssl provided self-signed certrificates takes precedence.

2. If you use a Document Root different from /var/www/html, a http request fetches the correct content, a https request is uses /var/www/html instead.

Same is true, if you use only one domain different from the server's domain name. And if you server several domains, you get this issue for the domain found first in the list of configuration files. 

The only solution found so far is to comment out the _default_ vhost in mod_ssl.conf

For more detailed information see section Troubleshooting in:
https://docs.fedoraproject.org/en-US/fedora-server/services/httpd-basic-setup/

One complain about the issue:
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/thread/3VFLS4VXKP6W5WDX2J2OV2WQVCIEZONH/#3VFLS4VXKP6W5WDX2J2OV2WQVCIEZONH



Reproducible: Always

Steps to Reproduce:
1. Install httpd and mod_ssl on Fedora (Server) 38 or 39
2. Create a vhost of the same FQN name as the server, specify a https and a http variant.
3. Use letsencrypt to generate a certificate and configure it in the vhost https section
Actual Results:  
You get a certificate complain, because the distribtuion provided self-signed certificate is used instead of the configured letsencrypt certificate.

A httpd  -S  lists 2 default 443 servers, the ssl_mod one and the user configured one 

Expected Results:  
use of the custom configured letsencrypt certificate

I think, instead of just fixing the ssl_mod configuration bug, it is better to restructure the configuration and package. The current configuration concept seems to have its origin at the time of Apache 2.0 or so. The meaning of _default_ as a dedicated default server was dropped with 2.4. It is now just an alias for *. The differentiation of main servers and various kinds of virtual host was dropped. Today it is just a virtual or named host and every domain is to be configured as virtual host. 

And it is time to include mod_ssl as part of the default httpd package. More or less everything is now requiring https. That opens the possibility to introduces domains as the first level directory structure in /var/www with "adefault" as preconfigured default domain and to provide a really working default vhost configuration which includes http (redirect) and https.

If it is helpful (and welcome/useful), I could provide a PR for the corresponding configuration files.  I currently chair the Fedora Server Working Group and specifically care about web service matters (among others)

Comment 1 Aoife Moloney 2024-11-13 10:27:29 UTC
This message is a reminder that Fedora Linux 39 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 39 on 2024-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '39'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 39 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 2 Aoife Moloney 2024-11-27 22:38:37 UTC
Fedora Linux 39 entered end-of-life (EOL) status on 2024-11-26.

Fedora Linux 39 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.