macOS Server 5.12 fails to export public key from the Profile Manager
The official doc says
Upload the public key certificate to the appropriate program and download the device enrollment token
https://support.apple.com/en-gb/guide/server/apd88446/mac
But It's not possible to retrieve the public key for registering MDM server on a clean installed macOS Monterey 12.1 with Server.app 5.12
Export option is just getting stuck in the disabled state
It worked fine on the Big Sur and even after updating from Big Sur to Monterey, but fails in 100% cases either after resetting Profile Manager or fresh Server install
Here are the Service Helper Logs
1:: [2796] [2021-12-24 04:04:26.318] Incoming request: readSimplifiedDeviceEnrollmentSettings
1:: [2796] [2021-12-24 04:05:38.124] Incoming request: getTokenEncryptionCertificate
1:: [2796] [2021-12-24 04:05:38.346] OpenSSLCreateSMIMEIdentity RESULT:
————————+———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
COMMAND | /usr/bin/openssl req -passin stdin -new -sha256 -key /Library/Server/ProfileManager/Config/ServiceData/Data/tmp/x_rdmtemp.rLwy1P,,,,8-pTDFYZ+tqjI.noindex.key -out /Library/Server/
| ProfileManager/Config/ServiceData/Data/tmp/x_rdmtemp.rLwy1P,,,,8-pTDFYYToGpw.noindex.csr -config /Library/Server/ProfileManager/Config/ServiceData/Data/tmp/x_rdmtemp.rLwy1P,,,,8-pTDFYS1jOYs.
| noindex.config -extensions v3_req
WD | /
————————+———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
STATUS | 1
————————+———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
STDERR | Error Loading extension section v3_req
————————+———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
STDOUT |
————————+———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
1:: [2796] [2021-12-24 04:29:57.652] EXCEPTION: !IF <NSString * _Nonnull OpenSSLCreateSMIMEIdentity(NSString * _Nullable __strong, NSString * _Nonnull __strong, NSString * _Nullable __strong, NSString * _Nonnull __strong, NSString * _Nonnull __autoreleasing * _Nonnull) (CryptoUtilities.m:1412): "'((status != 0))'">
So it seems like there's something wrong with a temporary generated openssl config. I've managed to catch the moment of its creation and there's no v3_req config here... just this
[req]
default_bits = 2048
distinguished_name = req_distinguished_name
prompt = no
[req_distinguished_name]
C = US
O = Example
CN = Profile Manager S/MIME Identity
emailAddress = example@mydomain.com
Does anyone know any workarounds?