Azure / azure-c-shared-utility

Azure C SDKs common code
Other
111 stars 203 forks source link

how to set client side certificate in tlsio #513

Closed yunhaoling closed 3 years ago

yunhaoling commented 3 years ago

hey, could I have a sample on how to set client certificate on tlsio? -- like which option name should I use and what value should I pass.

ericwolz commented 3 years ago

There is no sample for the tlsio layer, just for the public C SDK APIs. These are just passthru values to the tlsio layer.

https://github.com/Azure/azure-iot-sdk-c/blob/0d77ce8ff597baa5ccbb69d3ff863c86a5498165/iothub_client/samples/iothub_ll_client_x509_sample/iothub_ll_client_x509_sample.c#L166

yunhaoling commented 3 years ago

thanks @ericwol-msft! appreciate your quick response!

for my own tls learning, are OPTION_X509_CERT and OPTION_X509_PRIVATE_KEY the only two options to set for the client side certificate?

ericwolz commented 3 years ago

yes. You can trace thru the API call, and you should see it getting set on your TLS adaptor.

yunhaoling commented 3 years ago

thanks eric! I'll try it out! closing the issue now