uhttpd: Include new extensions in uhttpd self-signed certs
authorPat Fruth <pat@patfruth.com>
Wed, 1 May 2024 10:50:23 +0000 (13:50 +0300)
committerRobert Marko <robimarko@gmail.com>
Tue, 13 Aug 2024 19:07:13 +0000 (21:07 +0200)
commitdb4e8ef952f45e6b58467ffc82528cfae54dea42
treebcf05acf592e6cb2d1851cdd43d2b22b96e89da7
parentefca89daefc0347c64209e4e588fe17536933cf6
uhttpd: Include new extensions in uhttpd self-signed certs

The introduction of MacOS Catalina includes new requirements for self-signed certificates.
See: https://support.apple.com/en-us/HT210176
These new requirements include the addition of two TLS server certificate extensions.
- extendedKeyUsage
- subjectAltName
The extendedKeyUsage must be set to serverAuth.
The subjectAltName must be set to the DNS name of the server.
In the absense of these new extensions, when the LUCI web interface is configured to use HTTPS and
self-signed certs, MacOS user running Google Chrome browsers will not be able to access the LUCI web enterface.
If you are generating self-signed certs which do not include that extension, Chrome will
report "NET::ERR_CERT_INVALID" instead of "NET::ERR_CERT_AUTHORITY_INVALID".  You can click through to
ignore the latter, but not the former.

This change updates the uhttpd init script to generate self-signed cert that meets the new requirements.
Signed-off-by: Pat Fruth <pat@patfruth.com>
Link: https://github.com/openwrt/openwrt/pull/15366
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/network/services/uhttpd/files/uhttpd.init