Error when getting databases from IOM. The error is. System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure

This is code from Innovator 11 service pack 11 and I am recompiling for Release 30.

This is my code and it fails on Get Databases.


private HttpServerConnection conn;
private string serverURL;
private string database;
private string username;
private string password;

public Innovator Innovator { get; set; }
public IOMService()
{
serverURL = ConfigurationManager.AppSettings["serverURL"];
database = ConfigurationManager.AppSettings["database"];
username = ConfigurationManager.AppSettings["username"];
password = ConfigurationManager.AppSettings["password"];

conn = IomFactory.CreateHttpServerConnection(serverURL);
Innovator = GetInnovator();
}

private Innovator GetInnovator()
{
string[] databases = conn.GetDatabases();

if (databases.ToList().Contains(database))
{
conn = IomFactory.CreateHttpServerConnection(serverURL, database, username, password);

Item Result = conn.Login();

if (Result.isError())
{
string Error = string.Format("Unable to connect to myInnovator. Check credentials. {0} | {1} | {2}", serverURL, database, username);
}
else
{
string Success = string.Format("A connection has been established to MyInnovator");
}

return IomFactory.CreateInnovator(conn);
}

return null;
}

internal void Login()
{
conn.Login();
}

internal void Logout()
{
conn.Logout();
}
}
}