Hi, everyone!
Could you please check this question?
[https://stackoverflow.com/questions/48419314/x-509-certificates-exception-aws-iot][1]
I'm trying to connect to AWS IoT MQTT broker with X.509 certificates and I get an exception saying CryptographicException.
public AWSMqttManager()
{
//pfx fileName and password
var clientCert = new X509Certificate2("C:\\Users\\UNO\\Desktop\\...\\ttc20.pfx", "ttc20");
var caCert = X509Certificate.CreateFromSignedFile("C:\\Users\\UNO\\Desktop\\...\\VeriSign-Class 3-Public-Primary-Certification-Authority-G5.pem");
client = new MqttClient(IotEndpoint, BrokerPort, true, caCert, clientCert, MqttSslProtocols.TLSv1_2);
client.Connect("TTC-20");
}
CryptographicException: C:\Users\UNO\Desktop\...\VeriSign-Class 3-Public-Primary-Certification-Authority-G5.pem isn't signed.
System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromSignedFile (System.String filename) (at <9c9f068c46c64ffd91fda7af157b4d15>:0)
but the funny thing is the same code exactly works very well in pure c# project. That exception only occurs if I port that part of c# code onto unity project. Also the files (.pfx, .pem) do work for sure because I tested with MQTT.fx. They are fine.
Please help me a little bit!
Thanks in advance!
[1]: https://stackoverflow.com/questions/48419314/x-509-certificates-exception-aws-iot
↧