Bug 54240 - UDM REST API Swagger UI does not work when accessed through IP address
UDM REST API Swagger UI does not work when accessed through IP address
Status: NEEDMOREINFO
Product: UCS
Classification: Unclassified
Component: UDM - REST API
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-12-12 09:13 CET by Daniel Tröder
Modified: 2022-03-07 20:05 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2021-12-12 09:13:52 CET
The Swagger UI of the UDM REST API does not work when accessed through the IP address of the UCS server, only when accessed through the FQDN.

When testing UCS, customers may not have set up their test installations with proper DNS names and SSL. If they test the UDM REST API, it will seem to be broken, as it does not even log a request in the logfile.

It writes to the website: "TypeError: NetworkError when attempting to fetch resource." but displays a HTTP status 200.
Comment 1 Florian Best univentionstaff 2021-12-13 11:42:03 CET
$ host demo.univention.de
demo.univention.de has address 52.215.232.159

$ curl -k -i https://Administrator:univention@52.215.232.159/univention/udm/openapi.json

I can't reproduce this.
Of course the SSL/TLS certificate of apache is limited to the FQDN, if force-https is enabled.
Comment 2 Daniel Tröder univentionstaff 2021-12-13 14:45:53 CET
Open the "users/user -> get" section, click "Try" and execute the request. No objects will be shown.
Comment 3 Florian Best univentionstaff 2022-03-07 20:05:21 CET
OK. 

1. This currently requires working name resolution. The swagger UI accessed via IP address makes its request against the FQDN URI.
Error message in the Javascript console: 
http.js:118 GET https://master.demo.univention.de/univention/udm/appcenter/app/ net::ERR_NAME_NOT_RESOLVED

2. When I do this with working DNS resolution thje Javascript error console shows:
http.js:118 GET https://master80.school.dev/univention/udm/appcenter/app/ net::ERR_CERT_COMMON_NAME_INVALID

So my questions:
1. Which error do you get in the javascript console?
2. Should we adjust the openapi.json that it returns URL's based on the current request instead of hardcoded "https://$FQDN/" ? (This would have implications on all current clients)