Univention Bugzilla – Bug 54240
UDM REST API Swagger UI does not work when accessed through IP address
Last modified: 2022-03-07 20:05:21 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.
$ 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.
Open the "users/user -> get" section, click "Try" and execute the request. No objects will be shown.
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)