Azure / azure-iot-sdk-c

A C99 SDK for connecting devices to Microsoft Azure IoT services
https://azure.github.io/azure-iot-sdk-c
Other
587 stars 739 forks source link

Blob file upload fails in iOS devices #973

Closed awadeyar closed 5 years ago

awadeyar commented 5 years ago

Development Machine, OS, Compiler (and Other Relevant Toolchain Info) Mac 10.14.4 IDE: Xcode 10.2.1 Testing device iPhone 8 plus iOS 12.2

SDK Version (Please Give Commit SHA if Manually Compiling)

Release 2019-01-31

Protocol

MQTT

Describe the Bug

Connection to IoT hub is successful but uploading to blob fails on iOS devices. Same code works fine on iOS simulator.

MCVE

IoTHubClient_LL_UploadToBlob(handler, fileName,dataByte,dataByte.count)

Console Logs

Info: Waiting for TLS connection

Info: Waiting for TLS connection

Info: Waiting for TLS connection

2019-04-25 16:53:17.409966-0400 Demoapp[21611:5882823] CFNetwork SSLHandshake failed (-9807) 2019-04-25 16:53:17.410053-0400 Demoapp[21611:5882823] TCP Conn 0x283d146c0 SSLHandshake failed (-9807) Error: Time:Thu Apr 25 16:53:17 2019 /ios/Pods/AzureIoTUtility/pal/ios-osx/tlsio_appleios.c Func:dowork_read Line:447 Communications error while reading

Error: Time:Thu Apr 25 16:53:17 2019 /ios/Pods/AzureIoTUtility/adapters/httpapi_compact.c Func:on_io_error Line:444 Error signalled by underlying IO

Error: Time:Thu Apr 25 16:53:17 2019 ios/Pods/AzureIoTUtility/adapters/httpapi_compact.c Func:HTTPAPI_ExecuteRequest Line:1215 Send heads to HTTP failed (result = HTTPAPI_SEND_REQUEST_FAILED)

Error: Time:Thu Apr 25 16:53:17 2019 ios/Pods/AzureIoTUtility/src/httpapiex.c Func:HTTPAPIEX_ExecuteRequest Line:475 unable to recover sending to a working state

Error: Time:Thu Apr 25 16:53:17 2019/ios/Pods/AzureIoTHubClient/iothub_client/src/iothub_client_ll_uploadtoblob.c Func:IoTHubClient_LL_UploadToBlob_step1and2 Line:414 unable to HTTPAPIEX_SAS_ExecuteRequest

Error: Time:Thu Apr 25 16:53:17 2019 ios/Pods/AzureIoTHubClient/iothub_client/src/iothub_client_ll_uploadtoblob.c Func:IoTHubClient_LL_UploadMultipleBlocksToBlob_Impl Line:950 error in IoTHubClient_LL_UploadToBlob_step1

ewertons commented 5 years ago

Hi @awadeyar , are you trying to run one of our samples, or your own application? If it's your own, could you paste all the Azure IoT C SDK functions your are invoking, in the order and as you care invoking in your app?

Also, are you getting this error from your Mac, or from your iPhone?

awadeyar commented 5 years ago

Hello @ewertons ,

I am using MQTT sample from https://azure.microsoft.com/en-us/resources/samples/azure-iot-samples-ios/. It works fine on iOS simulators. On iPhone device it gives the above error.

az-iot-builder-01 commented 5 years ago

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