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

DeviceClient support for SSLSocketFactory #578

Closed
MMaiero opened this issue Sep 6, 2019 · 6 comments
Closed

DeviceClient support for SSLSocketFactory #578

MMaiero opened this issue Sep 6, 2019 · 6 comments
Assignees
Labels
enhancement fix checked in Fix checked into main or preview, but not yet released.

Comments

@MMaiero
Copy link

MMaiero commented Sep 6, 2019

  • OS and version used: Raspbian Buster

  • Java runtime used: openjdk version "1.8.0_181"

  • SDK version used: 0.22.0
    iot-device-client version 1.16.0

Description of the issue:

Is there any plan to extend the DeviceClient API to support the creation of a new DeviceClient passing an SSLSocketFactory? In this way, instead of passing the public and private keys as string everything could be managed in a simpler way using java primitives.

Code sample exhibiting the issue:

https://github.com/Azure/azure-iot-sdk-java/blob/master/device/iot-device-client/src/main/java/com/microsoft/azure/sdk/iot/device/DeviceClient.java#L207

Console log of the issue:

Need Support?

  • Have a feature request for SDKs? Please post it on User Voice to help us prioritize.
  • Have a technical question? Ask on Stack Overflow with tag “azure-iot-hub”
  • Need Support? Every customer with an active Azure subscription has access to support with guaranteed response time. Consider submitting a ticket and get assistance from Microsoft support team
  • Found a bug? Please help us fix it by thoroughly documenting it and filing an issue on GitHub (C, Java, .NET, Node.js, Python).
@timtay-microsoft
Copy link
Member

We currently don't have any plans to add this feature. Is there something preventing you from passing in the certificates as strings?

@MMaiero
Copy link
Author

MMaiero commented Sep 6, 2019

I see it as somewhat a security issue to have to keep a private key as string instead of having it in a keystore protected with a password. An passing that keystore as SSLSocketFactory to the Device Client.

@timtay-microsoft
Copy link
Member

Right now, an SSLSocketFactory instance is not enough information for our AMQP stack to work correctly. It requires the SDK to pass along an SSLContext instance instead. Would it still be worthwhile to you if the device client allowed you to pass in an SSLContext instance rather than an SSLSocketFactory instance?

@MMaiero
Copy link
Author

MMaiero commented Sep 15, 2019

Hello, I think that would work too, in my case.

@timtay-microsoft
Copy link
Member

This feature was just released in iot-device-client library version 1.19.0. Now you will be able to pass in an SSLContext to your client's constructor. This constructor allows for either SAS based auth, or x509 based auth depending on if your connection string has a device key or not. If no device key is present, the client will assume you loaded the necessary x509 certificates into the provided SSLContext

Since this issue has been released now, I'm closing this issue

@az-iot-builder-01
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement fix checked in Fix checked into main or preview, but not yet released.
Projects
None yet
Development

No branches or pull requests

3 participants