Azure IoT common library
Dependents: STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more
Diff: tlsio_wolfssl.c
- Revision:
- 31:6a55d47aea41
- Parent:
- 30:ce3813c5a692
- Child:
- 38:ed9c888e5e12
diff -r ce3813c5a692 -r 6a55d47aea41 tlsio_wolfssl.c --- a/tlsio_wolfssl.c Fri Jul 14 16:38:40 2017 -0700 +++ b/tlsio_wolfssl.c Fri Aug 11 14:03:20 2017 -0700 @@ -420,7 +420,7 @@ int result; if (tls_io_instance->certificate != NULL) { - int res = wolfSSL_CTX_load_verify_buffer(tls_io_instance->ssl_context, (const unsigned char*)tls_io_instance->certificate, strlen(tls_io_instance->certificate) + 1, SSL_FILETYPE_PEM); + int res = wolfSSL_CTX_load_verify_buffer(tls_io_instance->ssl_context, (const unsigned char*)tls_io_instance->certificate, strlen(tls_io_instance->certificate), SSL_FILETYPE_PEM); if (res != SSL_SUCCESS) { LogError("wolfSSL_CTX_load_verify_buffer failed"); @@ -442,12 +442,12 @@ int result; - if (wolfSSL_use_certificate_buffer(ssl, (unsigned char*)x509certificate, strlen(x509certificate) + 1, SSL_FILETYPE_PEM) != SSL_SUCCESS) + if (wolfSSL_use_certificate_chain_buffer(ssl, (unsigned char*)x509certificate, strlen(x509certificate)) != SSL_SUCCESS) { LogError("unable to load x509 client certificate"); result = __FAILURE__; } - else if (wolfSSL_use_PrivateKey_buffer(ssl, (unsigned char*)x509privatekey, strlen(x509privatekey) + 1, SSL_FILETYPE_PEM) != SSL_SUCCESS) + else if (wolfSSL_use_PrivateKey_buffer(ssl, (unsigned char*)x509privatekey, strlen(x509privatekey), SSL_FILETYPE_PEM) != SSL_SUCCESS) { LogError("unable to load x509 client private key"); result = __FAILURE__; @@ -530,7 +530,7 @@ void tlsio_wolfssl_deinit(void) { } - + CONCRETE_IO_HANDLE tlsio_wolfssl_create(void* io_create_parameters) { TLS_IO_INSTANCE* result;