cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

How to configure SSL certificate programmatically

htran-21
15-Moonstone

How to configure SSL certificate programmatically

Hi,

 

I have a config.json (it works fine) like

 

 

 

{
  "certificates": {
    "validate": true,
    "allow_self_signed": false,
    "cert_chain": [
      "/path2cert/entrust_l1k.pem",
      "/path2cert/entrust_g2.pem"
    ]
  }
  ...
}

 

 

 

 

How could i write it in programming? Because ServerCertFileInfo property only allow me to specify one cert file

 

 

 

var client = new ConnectedThingClient(new ClientConfigurator
{
	AllowSelfSignedCertificates = false,                
	DisableCertValidation = false,
	ServerCertFileInfo = new CertFileInfo { CertType = 0 /* TLS */, FilePath = @"/path2cert/entrust_g2.pem" },
	
	...
});

 

 

 

 

Any help would be greatly appreciated

 

Regards,

Hung Tran

 

 

5 REPLIES 5

 Hi,

 

Some helpful articles:

 

From "Help Center" - ".NET SDK: ClientConfigurator Class": http://support.ptc.com/help/edge_sdk_dotnet/r5.8.0/en/index.html#page/dotnet_sdk/c_dotnet_sdk_reference_clientconfigurator_class.html 

 

Discussion earlier - "Client certificate authentication in Java": https://community.ptc.com/t5/ThingWorx-Developers/Client-certificate-authentication-in-Java/td-p/528567 

htran-21
15-Moonstone
(To:VladimirN)

Hi,

 

Thanks for your quick reply, however you misread my question, the Thingworx server is configured properly, it's already been working with config.json + wsems / localems. I just don't know how to setup cert chain for the ClientConfigurator object.

 

Regards,

Hung Tran

Hello @htran-21 ,

 

pls check the following article to set up cert for CCO.

https://www.ptc.com/en/support/article/cs272670

 

Let me know if that helps.

 

Regards

Bhawna

htran-21
15-Moonstone
(To:bchaudhary)

Hi Bhawna,

 

I visited the link but that does not provide any details.

htran21_0-1644417127949.png

Regards,

Hung Tran

You can find a detailed solution in the attached PDF file.

Top Tags