When running from a user context, nsurl connection succeeds. When running from the system context the error listed below is generated.
macOS 12+
Thanks for any help
Network error: Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={_kCFStreamErrorDomainKey=3, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorCodeKey=-9802, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://<host server>/st/console/privateapi/v3.0/agentsupport/registration/policies/bycookie?agentId=294f0fd5ebbd093df4f801c5ab020b976323e273&hostname=pch-imac&dnsDomain=eng.landesk.com&fqdn=pch-imac.eng.landesk.com&netBiosDomain=eng.landesk.com&authorizationCookie=<password>, NSErrorFailingURLStringKey=https://<host server>/st/console/privateapi/v3.0/agentsupport/registration/policies/bycookie?agentId=294f0fd5ebbd093df4f801c5ab020b976323e273&hostname=pch-imac&dnsDomain=eng.landesk.com&fqdn=pch-imac.eng.landesk.com&netBiosDomain=eng.landesk.com&authorizationCookie=<password>, NSErrorClientCertificateStateKey=0}
Error: Error Domain=com.ivanti.iAgent.Registration Code=100 "{
NSErrorClientCertificateStateKey = 0;
NSErrorFailingURLKey = "https://<host server>/st/console/privateapi/v3.0/agentsupport/registration/policies/bycookie?agentId=294f0fd5ebbd093df4f801c5ab020b976323e273&hostname=pch-imac&dnsDomain=eng.landesk.com&fqdn=pch-imac.eng.landesk.com&netBiosDomain=eng.landesk.com&authorizationCookie=<password>";
NSErrorFailingURLStringKey = "https://<host server>/st/console/privateapi/v3.0/agentsupport/registration/policies/bycookie?agentId=294f0fd5ebbd093df4f801c5ab020b976323e273&hostname=pch-imac&dnsDomain=eng.landesk.com&fqdn=pch-imac.eng.landesk.com&netBiosDomain=eng.landesk.com&authorizationCookie=<password>";
NSLocalizedDescription = "An SSL error has occurred and a secure connection to the server cannot be made.";
NSLocalizedRecoverySuggestion = "Would you like to connect to the server anyway?";
"_kCFStreamErrorCodeKey" = "-9802";
"_kCFStreamErrorDomainKey" = 3;
}" UserInfo={NSLocalizedDescription={
NSErrorClientCertificateStateKey = 0;
NSErrorFailingURLKey = "https://<host server>/st/console/privateapi/v3.0/agentsupport/registration/policies/bycookie?agentId=294f0fd5ebbd093df4f801c5ab020b976323e273&hostname=pch-imac&dnsDomain=eng.landesk.com&fqdn=pch-imac.eng.landesk.com&netBiosDomain=eng.landesk.com&authorizationCookie=<password>";
NSErrorFailingURLStringKey = "https://<host server>/st/console/privateapi/v3.0/agentsupport/registration/policies/bycookie?agentId=294f0fd5ebbd093df4f801c5ab020b976323e273&hostname=pch-imac&dnsDomain=eng.landesk.com&fqdn=pch-imac.eng.landesk.com&netBiosDomain=eng.landesk.com&authorizationCookie=<password>";
NSLocalizedDescription = "An SSL error has occurred and a secure connection to the server cannot be made.";
NSLocalizedRecoverySuggestion = "Would you like to connect to the server anyway?";
"_kCFStreamErrorCodeKey" = "-9802";
"_kCFStreamErrorDomainKey" = 3;
}}