Bug 53296 - UMC in Portal does not work with "apache2/force_https: yes"
UMC in Portal does not work with "apache2/force_https: yes"
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Portal
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-1-errata
Assigned To: Ildefonso González Sánchez
Julia Bremer
https://git.knut.univention.de/univen...
:
: 54245 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-05-20 17:35 CEST by Dirk Wiesenthal
Modified: 2022-01-20 18:08 CET (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.257
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2021122821000267
Bug group (optional):
Max CVSS v3 score:


Attachments
certificatefile .pem format that include subjectAlNames (DNS and IP) (1.94 KB, text/plain)
2022-01-04 16:01 CET, Ildefonso González Sánchez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2021-05-20 17:35:30 CEST
UMC in Portal relies on a HTTP request against UMC.

But apache2/force_https: yes redirects a call against

http://127.0.0.1/univention/get/modules

to

https://127.0.0.1/univention/get/modules

which then in turn leads to:

 23968 umc          21-05-20 17:10:15 [ WARNING]: Exception while getting modules: HTTPSConnectionPool(host='10.200.23.240', port=443): Max retries exceeded with url: /univention/get/modules (Caused by SSLError(SSLCertVerificationError("hostname '10.200.23.240' doesn't match either of 'primary.intranet.univention.de', 'primary'")))
Comment 1 Dirk Wiesenthal univentionstaff 2021-05-20 17:38:52 CEST
Result: UMC does not show up at all. As if "ShowUMC" was not set in this portal.

/univention/umc/ does not work at all (empty)

/univention/management/ works...
Comment 3 Florian Best univentionstaff 2021-05-21 11:29:23 CEST
Fix would be:

ucr set apache2/force_https/exclude/request_uri/univention-portal=/univention/get
Comment 6 Dirk Schnick univentionstaff 2021-12-28 13:00:38 CET
Customer reported that problem during another debug session. Ticket number is attached.
If the correction is the ucr, why don't we publish that?
Comment 8 Ildefonso González Sánchez univentionstaff 2022-01-04 16:01:29 CET
Created attachment 10893 [details]
certificatefile .pem format that include subjectAlNames (DNS and IP)
Comment 9 Ildefonso González Sánchez univentionstaff 2022-01-04 16:06:52 CET
During certificate creation process, this could be an example of solution using openssl with subject Alternative Name using openssl:

openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes   -keyout example.key -out example.pem -subj "/CN=ucs-1428.igs-ldap.intranet"   -addext "subjectAltName=DNS:ucs-1428.igs-ldap.intranet,DNS:ucs-1428,IP:10.200.88.2,IP:127.0.0.1,DNS:localhost"
Generating a RSA private key
....................................................................................++++
................................++++
writing new private key to 'example.key'
-----

(This keypair should be signed by CA    -CA ca-cert.pem  -CAkey ca-key.pem).
Comment 10 Ildefonso González Sánchez univentionstaff 2022-01-04 16:31:29 CET
(In reply to fonsi from comment #9)
> During certificate creation process, this could be an example of solution
> using openssl with subject Alternative Name using openssl:
> 
> openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes   -keyout
> example.key -out example.pem -subj "/CN=ucs-1428.igs-ldap.intranet"  
> -addext
> "subjectAltName=DNS:ucs-1428.igs-ldap.intranet,DNS:ucs-1428,IP:10.200.88.2,
> IP:127.0.0.1,DNS:localhost"
> Generating a RSA private key
> .............................................................................
> .......++++
> ................................++++
> writing new private key to 'example.key'
> -----
> 
> (This keypair should be signed by CA    -CA ca-cert.pem  -CAkey ca-key.pem).

The installation process it seems the following bash script: /ucs/base/univention-ssl/make-certificates.sh

that invoke extensions on: _common_gen_cert () {

And we should include new extensions to: /ucs/base/univention-ssl/extensions-example.sh

cat extensions-example.sh | grep -A3 alt
# alternative name
subjectAltName = DNS:$fqdn, DNS:$hostname
EOF

such localmachine IP, localhost or 127.0.0.1
Comment 12 Ildefonso González Sánchez univentionstaff 2022-01-10 10:23:51 CET
Approved solution for the bug: ucr set apache2/force_https/exclude/request_uri/univention-portal=/univention/get

Approved solution for SSLCertVerificationError error: https://git.knut.univention.de/univention/ucs/-/merge_requests/225
Comment 17 Ildefonso González Sánchez univentionstaff 2022-01-12 12:22:14 CET
The implemented solution configure the univention portal post-installetion for allow  http request to the path: /univention/get for the univention-portal-managment when the ucr field apache2/force_https is setting to yes.

The build process of univention-portal should make with the npm version: 8.1.3

And the commit changes list: 
d84c557ce0 Bug #53296: update YAML for univention-portal
50883c2236 Bug #53296 npm version fixed to 8.1.3 due to error when trying to build with latest version.
aa9a514d0b Bug #53296: update univention-portal postinst
Comment 18 Julia Bremer univentionstaff 2022-01-19 13:04:51 CET
(Additional commits have been made)
458366d9e5 Bug #53296: update errate YAML fix version
a46078c673 Bug #53296: update question mark instead of equal when exclusion https is setting


OK: Portal tiles are shown again
OK: UCR is not overwritten if already set
OK: YAML (there was a leftover whitespace at the end of the version number, which I'll fix before releasing)

Verified
Comment 20 Philipp Hahn univentionstaff 2022-01-20 18:08:54 CET
*** Bug 54245 has been marked as a duplicate of this bug. ***