From 7a83e5a41a2bf0508e46cbb9c2f992bb55c8606b Mon Sep 17 00:00:00 2001 From: KIM JungYong Date: Thu, 29 Sep 2016 20:43:29 +0900 Subject: [PATCH] Fix for request to secure resource server. When send to discovered secure resource server, client should change port to secure channel port. But, it is not apply at notification consumer service. In this patch, when discover secure notification resource consumer service will send request with changed port for secure. Change-Id: Ib8101753be76996fa4978d7714e8cf474278f771 Signed-off-by: KIM JungYong Reviewed-on: https://gerrit.iotivity.org/gerrit/12561 Tested-by: jenkins-iotivity Reviewed-by: Chihyun Cho Reviewed-by: Uze Choi (cherry picked from commit 2cb04ce3be4473203e253258b526ca903cdcfba2) Reviewed-on: https://gerrit.iotivity.org/gerrit/12619 --- service/notification/src/consumer/NSConsumerDiscovery.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/service/notification/src/consumer/NSConsumerDiscovery.c b/service/notification/src/consumer/NSConsumerDiscovery.c index 44c6a19..a812d34 100644 --- a/service/notification/src/consumer/NSConsumerDiscovery.c +++ b/service/notification/src/consumer/NSConsumerDiscovery.c @@ -125,7 +125,14 @@ OCStackApplicationResult NSProviderDiscoverListener( type = CT_ADAPTER_TCP; } - NSInvokeRequest(NULL, OC_REST_GET, clientResponse->addr, + OCDevAddr * addr = clientResponse->addr; + if (resource->secure) + { + addr->port = resource->port; + addr->flags |= OC_FLAG_SECURE; + } + + NSInvokeRequest(NULL, OC_REST_GET, addr, resource->uri, NULL, NSIntrospectProvider, ctx, type); } -- 2.7.4