There is a GlobalSign CA. In most cases its root certificate is already exists in the Windows Certificates storage.
But sometimes (especially on old Windows versions) the storage doesn't contain the certificate.

I need to check if the certificate exists and import it if does not. I exported the certificate to a file and imported it using the code below:

```
public void ImportCertificate(StoreName storeName,
    StoreLocation location,
    byte[] certificateData)
{
    X509Store x509Store = new X509Store(storeName, location);
    X509Certificate2 certificate = new X509Certificate2(certificateData);
    x509Store.Open(OpenFlags.ReadWrite);
    x509Store.Add(certificate);
    x509Store.Close();
}

```

The code adds the certificate but all certificate purposes are checked:

[![Result](https://i.stack.imgur.com/NfPuo.png)](https://i.stack.imgur.com/NfPuo.png)

I don't want to add extra purposes to the certificate just want to set those ones which have other root CAs like below:

[![Expect](https://i.stack.imgur.com/tAXRR.png)](https://i.stack.imgur.com/tAXRR.png)

How to do it programatically?
['https://Stackoverflow.com/questions/53867961', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4675884/']
AWS have now launched Amazon ECS Exec, which allows you to directly interact with containers: <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html>.
As i know and having experience on ECS you are not allowed to do it. aws does not give you access to the underlying resources.

if you are using fargate + EC2 Configuration then also it is not to access EC2.