-
Notifications
You must be signed in to change notification settings - Fork 496
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
GetFileUploadSasUriAsync throws NullReferenceException when using CA signed certificates to authenticate the device #1527
Comments
Do you have the corresponding CA certs uploaded to your hub instance? |
Yes, I do. I am able to connect to IoTHub and perform other operations except retrieving SAS URI for file upload. |
We can repo this issue in the SDK. Working on a fix now. |
We have checked in the fix for this issue, we will be releasing a new version of the Device SDK soon. |
Thank you for the info. |
I have just tested it with version built from current master, and it works. There is one more thing. Client internally uses HTTPS to obtain the token, even though primary connection uses AMQP. Would it possible that entire communication is done over primary protocol? |
Thanks for letting us know, We will bring these changes to the preview and release a new version shortly. Yes, the only available protocol for the file upload APIs on the IoTHub service is HTTP, so regardless of the protocol you indicate when you are instantiating the DeviceClient, we will open an HTTP client. One option would be for you to use SAS token credentials but since you are using certificates and those are generally preferred over SAS tokens, I am not sure that is the path you want to explore right? The certificate limit is imposed by the service and Andrei ( @ailn ) might be able to provide guidance on what is recommended here. |
@Perun85 We have published a new release for .NET SDK (both master and preview versions) |
Thank you for the info. |
@abhipsaMisra, @Perun85, @azabbasi, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey |
When CA signed certificates are used to authenticate the device, method GetFileUploadSasUriAsync throws NullReferenceException.
StackTrace
at Microsoft.Azure.Devices.Client.IotHubConnectionString.Microsoft.Azure.Devices.Client.IAuthorizationProvider.GetPasswordAsync() at Microsoft.Azure.Devices.Client.Transport.HttpClientHelper.<ExecuteAsync>d__21.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Devices.Client.Transport.HttpClientHelper.<PostAsync>d__17
2.MoveNext()at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable
1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.Devices.Client.Transport.HttpTransportHandler.<GetFileUploadSasUri>d__15.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable
1.ConfiguredTaskAwaiter.GetResult()at Microsoft.Azure.Devices.Client.InternalClient.d__77.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()
The text was updated successfully, but these errors were encountered: