Hello,
I want to use the Toradex example ‘azure-iot-sdk -c/Iothub_client/samples /iothub_client_sample_http/’ (on github) access the cloud. If I work without a firewall, then the connection to Cloud works. Is the firewall active, the connection is blocked.
Is there a way that the proxy setting (server address, port, user, password) can be set in the Windows Compact Image / Registry?
It’s not an issue about the image. You can configure the HTTP implementation in CE (coming from Internet Explorer) but the SDK is not using that, it uses sockets directly.
To support proxy you need to change the implementation in the file I pointed out in my previous reply.
For HTTP (unencrypted) requests you can simply send the whole URL (domain and path) to the proxy server, for HTTPS you need first to send a CONNECT command to establish a connection to the end server getting it’s SLL certificates then, after SLL handshake, you can send the GET request directly to the target because your HTTP proxy should have established a “tunneled” connection to the end-point.
Some proxy also supports the “old” HTTP behavior via HTTPS, taking just the GET request and behaving as a man-in-the-middle. If you can control your proxy this may be the simplest implementation, but may not be compatible with 100% of HTTP proxies out there.
I think that this is used with protocols that use the TLS interface (MQTT, AMQP) but, unfortunately, not for HTTP. For HTTP there are platform-specific implementations. On Linux it uses curl, for desktop Windows the WINHTTP api and for CE sockets.
As you can see in:
TLS_IO is currently not supported on CE.
I ported mbedTLS to CE (it’s really just a matter of rebuilding it), and so the mbed implementation may be adapted for this, but in that case you could probably use AMQP and MQTT but not HTTPS.
If you port the TLS layer to CE you may use this HTTP implementation:
but it’s something I did not test.
If you want we can have a call discussing this, it may be faster than discussing it with messages.
I may try to help you do the implementation, but at the moment we can’t allocate resources on this.
The MQTT or AMPQ protocols would be even better than HTTP. I tried both protocols with the example code ‘iothub_client_sample_mqtt_ws’ or ‘iothub_client_sample_ampq_ws’. I found this in Source “TLS IO interface currently not supported on WEC 2013”.
If we can use mbedTLS here, this would be fine as we port mbedTLS to the platform.
Do you have an example that we can integrate mbedTLS into the azure SDK?
you can find the changes needed to build mbedtls for CE using cmake.
Those may not be for the latest release.
Then you should be able to link it to CE-specific code, in the same way it’s built for mbed.