Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

401002 CA certificate not found - SDK - Microsoft.Azure.Devices.Provisioning.Client #573

Closed
BhupalPatil opened this issue Aug 23, 2019 · 4 comments

Comments

@BhupalPatil
Copy link

BhupalPatil commented Aug 23, 2019

OS - Windows 10
.net Environment - .net core 2.1
SDK - Microsoft.Azure.Devices.Client - 1.21.0
Microsoft.Azure.Devices.Provisioning.Client - 1.4.0
Microsoft.Azure.Devices.Provisioning.Transport.Amqp - 1.1.9
Microsoft.Azure.Devices.Provisioning.Transport.Http - 1.1.6
Microsoft.Azure.Devices.Provisioning.Transport.Mqtt - 1.1.8

Description of the issue:

I'm trying to conect simulated device (.net core console app) to IOT hub via azure Device Provisioning Service. this is based on x.509 cetificates (root+ interimidiate certificate).

I created the enrollment group ok, then uploaded the root certificate and completed verification.

After that generated the device certificate from root certificate and tried to connect to IOT hub using sample code from below link:

https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/provisioning/Samples/device/X509Sample

After having all setup when I tried to connect to IOT bub I'm getting below error, tried all protocol - Amqp,Http,Mqtt...

Microsoft.Azure.Devices.Provisioning.Client.ProvisioningTransportException
HResult=0x80131500
Message={"errorCode":401002,"trackingId":"408d5ad7-aa7c-45a1-b19a-e4af41ccf54b","message":"CA certificate not found.","timestampUtc":"2019-08-23T09:17:53.762099Z"}
Source=
StackTrace:

private static string s_idScope = "XXXXXXXX";
private const string GlobalDeviceEndpoint = "global.azure-devices-provisioning.net";
private static string s_certificateFileName = "simulateddevicecert.pfx";

anything missing in the setup that is causing this error?
also I there any rest api exposed by azure DPS to register device (instead of using Azure Devices/Client SDK)

@timtay-microsoft
Copy link
Member

You seem to be using the C# SDK, not the Java SDK. Since this is the issues page for the Java SDK, I'm closing this issue as off-topic. I recommend filing this issue on this page instead.

@az-iot-builder-01
Copy link
Collaborator

@BhupalPatil, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey

@timtay-microsoft
Copy link
Member

timtay-microsoft commented Aug 23, 2019

@BhupalPatil
Copy link
Author

@timtay-microsoft, Thanks for pointing to right page. I tried to trace this issue further and created new issue with latest finding : Azure/azure-iot-sdk-csharp#1040

Thanks.
Bhupal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants