Just upgraded our portal to 10.7 and now cannot connect from Runtime application
Receive the following error:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
The remote certificate is invalid according to the validation procedure.
This same code worked at 10.6.1 (and has worked on previous versions). If I change to using agol it will work
public async Task<TokenCredential> GetPortalCredential(string user, string password)
{
try
{
var portalUri = new Uri($"{ConfigurationSettings.PortalUrl}/sharing/rest");
var credential = await AuthenticationManager.Current.GenerateCredentialAsync(portalUri, user, password);
return credential;
}
catch (Exception e)
{
_log.Log(e.Message, Category.Exception, Priority.None);
return null;
}
}
This error would happen if your server's SSL certificate is invalid (or missing). According to this page, SSL is now default in 10.7: http://enterprise.arcgis.com/en/server/latest/get-started/windows/what-s-new-in-arcgis-for-server.htm