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

Exception on the file uploading with a x509 certificate device #60

Closed
walkerlin-msft opened this issue Feb 22, 2017 · 7 comments
Closed
Assignees
Labels
CSS enhancement New feature or request.

Comments

@walkerlin-msft
Copy link

I got an exception on UploadFileToBlob method in the x509 certificate device.
Does it support file upload feature in the x509 device?

(Microsoft.Azure.Devices.Client) Version: 1.2.3

Here is the log:

Type of Exception : ArgumentException
Message : '' is not a valid Base64 encoded string.
Parameter name: Key
Source : Microsoft.Azure.Devices.Client
Stack Trace : at Microsoft.Azure.Devices.Client.StringValidationHelper.EnsureBase64String(String value, String paramName)
at Microsoft.Azure.Devices.Client.IotHubConnectionString.BuildToken(TimeSpan& ttl)
at Microsoft.Azure.Devices.Client.IotHubConnectionString.GetPassword()
at Microsoft.Azure.Devices.Client.IotHubConnectionString.GetAuthorizationHeader()
at Microsoft.Azure.Devices.Client.Transport.HttpClientHelper.d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Devices.Client.Transport.HttpClientHelper.d__16`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Devices.Client.Transport.HttpTransportHandler.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Microsoft.SmartFactory.Devices.Client.SfDeviceClient.d__16.MoveNext() in C:\Users\a-walin\Github\MOEA-SmartFactory\sfDeviceLib\CSSDK\SfDeviceClient.cs:line 110
TargetSite : Void EnsureBase64String(System.String, System.String)

Thanks for the help.

@tameraw
Copy link
Contributor

tameraw commented Feb 22, 2017

@walkerlin-msft - We had not enabled X509 with FileUpload yet. It is in our backlog to enable it. We also welcome contributions to our repo if this interests you. You can find our contribution guideline here: https://github.com/Azure/azure-iot-sdk-csharp/blob/master/CONTRIBUTING.md

@tameraw tameraw added enhancement New feature or request. CSS labels Feb 22, 2017
@walkerlin-msft
Copy link
Author

Got it and will keep tracking the updates.
Thanks a lot.

@asergaz
Copy link
Contributor

asergaz commented Mar 24, 2017

Hello @walkerlin-msft have a look at the commit Issue #60: enabling X509 support with FileUpload and test it. The changes will be added to the master branch soon. Thanks :)!

All Best.

@asergaz asergaz closed this as completed Mar 27, 2017
@asergaz asergaz self-assigned this Mar 27, 2017
@walkerlin-msft
Copy link
Author

Hi @sergaz-msft thanks for your updates. I've tested it successfully in my codes. I'm look forward to see the release update in the master branch.
Thanks a lot.

@adamkjonesmesh
Copy link

I am trying to upload a file to IoT hub using x.509 certs but am receiving an exception every time. The exception is "Object reference not set to the instance of an object". The inner exception is below:

StackTrace [string]:" at Microsoft.Azure.Devices.Client.IotHubConnectionString.Microsoft.Azure.Devices.Client.IAuthorizationProvider.GetPasswordAsync()\r\n at Microsoft.Azure.Devices.Client.Transport.HttpClientHelper.ExecuteAsync(HttpMethod httpMethod, Uri requestUri, Func3 modifyRequestMessageAsync, Func2 isSuccessful, Func3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken)\r\n at Microsoft.Azure.Devices.Client.Transport.HttpClientHelper.PostAsync[T1,T2](Uri requestUri, T1 entity, IDictionary2 errorMappingOverrides, IDictionary2 customHeaders, CancellationToken cancellationToken)\r\n at Microsoft.Azure.Devices.Client.Transport.HttpTransportHandler.UploadToBlobAsync(String blobName, Stream source)"

I am using Microsoft.Azure.Devices.Client 1.7.2. Is file uploading using x.509 still not supported?

@CIPop
Copy link
Member

CIPop commented Jul 2, 2018

@adamkjonesmesh please open a separate GH issue.

@adamkjonesmesh
Copy link

Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

5 participants