Skip to content

[Edge Transparent Gateway scenario]Send message using x509=true in connection string #969

@amit12cool

Description

@amit12cool

I have set up transparent gateway with downstream device being authenticated to gateway using x509 auth mechanism.
My connection string in the downstream device code is as below:-
HostName={hostname};DeviceId={downstreamDeviceId};x509=true

The error is I get while instantiating the deviceclient is as below:-

Unexpected error Invalid Connection String - Invalid Key 
Shutting down IoT Hub Client...
Traceback (most recent call last):
  File "./iotagent.py", line 84, in <module>
    main()
  File "./iotagent.py", line 73, in main
    loop.run_until_complete(dowork())
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "./iotagent.py", line 53, in dowork
    device_client = DeviceClient(registration_result, x509)
  File "/app/iotagent/device_client.py", line 21, in __init__
    server_verification_cert=root_ca_cert
  File "/usr/local/lib/python3.7/site-packages/azure/iot/device/aio/patch_documentation.py", line 85, in create_from_connection_string
    connection_string, **kwargs
  File "/usr/local/lib/python3.7/site-packages/azure/iot/device/iothub/abstract_clients.py", line 257, in create_from_connection_string
    connection_string = cs.ConnectionString(connection_string)
  File "/usr/local/lib/python3.7/site-packages/azure/iot/device/common/auth/connection_string.py", line 83, in __init__
    self._dict = _parse_connection_string(connection_string)
  File "/usr/local/lib/python3.7/site-packages/azure/iot/device/common/auth/connection_string.py", line 50, in _parse_connection_string
    raise ValueError("Invalid Connection String - Invalid Key")
ValueError: Invalid Connection String - Invalid Key

It seems as per this code, the key x509 is not supported in python sdk. Or am I missing something?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions