<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi, in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112056#M72697</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm getting timeout error when i try to open the url of your service, can you check that it is correct and accessible?&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;i don't get a response even in a browser.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Can you also detail for me the steps you took to generate the server key you use?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;

&lt;P&gt;Dennis.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 03 Jul 2016 12:10:00 GMT</pubDate>
    <dc:creator>Dennis_F_Intel</dc:creator>
    <dc:date>2016-07-03T12:10:00Z</dc:date>
    <item>
      <title>Problem with App Security API. Calling a web service in a server with self signed certificate</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112053#M72694</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN&gt;I&lt;/SPAN&gt;&lt;SPAN&gt;'m developing an&lt;/SPAN&gt; &lt;SPAN&gt;apk&lt;/SPAN&gt; &lt;SPAN&gt;that&lt;/SPAN&gt; &lt;SPAN&gt;communicates with a&lt;/SPAN&gt; &lt;SPAN&gt;web service&lt;/SPAN&gt; &lt;SPAN&gt;with&lt;/SPAN&gt; &lt;SPAN&gt;a self-signed&lt;/SPAN&gt; &lt;SPAN&gt;certificate and&lt;/SPAN&gt; &lt;SPAN&gt;have problems with&lt;/SPAN&gt; &lt;SPAN&gt;the&lt;/SPAN&gt; &lt;SPAN&gt;App&lt;/SPAN&gt; &lt;SPAN&gt;Security&lt;/SPAN&gt; &lt;SPAN&gt;API.&lt;/SPAN&gt;&lt;BR /&gt;
	&amp;nbsp; &lt;SPAN&gt;-&lt;/SPAN&gt; &lt;SPAN&gt;The error&lt;/SPAN&gt; &lt;SPAN&gt;that gives&lt;/SPAN&gt; &lt;SPAN&gt;me&lt;/SPAN&gt; &lt;SPAN&gt;the device&lt;/SPAN&gt; &lt;SPAN&gt;is "&lt;/SPAN&gt;&lt;SPAN&gt;fail:&lt;/SPAN&gt; &lt;SPAN&gt;code =&lt;/SPAN&gt; &lt;SPAN&gt;33&lt;/SPAN&gt;&lt;SPAN&gt;, message&lt;/SPAN&gt; &lt;SPAN&gt;authentication&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Communication&lt;/SPAN&gt; &lt;SPAN&gt;error"&lt;/SPAN&gt;&lt;BR /&gt;
	&amp;nbsp; &lt;SPAN&gt;-&lt;/SPAN&gt; &lt;SPAN&gt;And&lt;/SPAN&gt; &lt;SPAN&gt;in the emulator&lt;/SPAN&gt; &lt;SPAN&gt;error&lt;/SPAN&gt; &lt;SPAN&gt;is "&lt;/SPAN&gt;&lt;SPAN&gt;fail:&lt;/SPAN&gt; &lt;SPAN&gt;code =&lt;/SPAN&gt; &lt;SPAN&gt;16&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN&gt;message =&lt;/SPAN&gt; &lt;SPAN&gt;Server not&lt;/SPAN&gt; &lt;SPAN&gt;accessible&lt;/SPAN&gt; &lt;SPAN&gt;error"&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;SPAN&gt;This is the function&lt;/SPAN&gt;&lt;SPAN&gt;, the lines&lt;/SPAN&gt; &lt;SPAN&gt;discussed&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN&gt;I think they are&lt;/SPAN&gt; &lt;SPAN&gt;not useful&lt;/SPAN&gt; &lt;SPAN&gt;because the function of&lt;/SPAN&gt; &lt;SPAN&gt;webservice&lt;/SPAN&gt; &lt;SPAN&gt;which&lt;/SPAN&gt; &lt;SPAN&gt;I call&lt;/SPAN&gt; &lt;SPAN&gt;has no&lt;/SPAN&gt; &lt;SPAN&gt;input parameter,&lt;/SPAN&gt; &lt;SPAN&gt;ie&lt;/SPAN&gt; &lt;SPAN&gt;data&lt;/SPAN&gt; &lt;SPAN&gt;only returns&lt;/SPAN&gt; &lt;SPAN&gt;me&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;function Prueba(){
    var options = { url: "https://XXXXXXXXXX", method:'POST', serverKey: "-----BEGIN PUBLIC KEY-----\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-----END PUBLIC KEY-----" };
    intel.security.secureTransport.open(
        function (instanceID) {
		alert("Succeeded in open, instance id is: "+instanceID);
                var instance=instanceID;
			// Define the head Content-type
//    		intel.security.secureTransport.setHeaders(
//        		function(){
//					alert('Succeeded in setHeaderValue');
//					// Send the request
//					intel.security.secureTransport.sendRequest(
//						function(response){alert(response.responseBody);}, 
//						function(errorObj){alert('fail: code = '+errorObj.code+', message = '+errorObj.message);},
//						{instanceID:instance, requestBody:'', requestFormat:'JSON'}
//					);     
//				}, 
//        		function(errorObj){alert('fail: code = '+errorObj.code+', message = '+errorObj.message);},
//        		{instanceID:instance, 'key':'Content-Type', 'value':'application/xml'}
//    		);
            intel.security.secureTransport.sendRequest(
                function(response){alert(response.responseBody);}, 
                function(errorObj){alert('fail: code = '+errorObj.code+', message = '+errorObj.message);},
                {instanceID:instance, requestBody:'', requestFormat:'JSON'}
            ); 
        },
        function (errorMsg) {
            alert("failed callback is called, code: "+errorMsg.code+', message = '+errorMsg.message);
        },
        options
    );
}&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN&gt;I have seen the&lt;/SPAN&gt; &lt;SPAN&gt;following thread&lt;/SPAN&gt; &lt;SPAN&gt;because&lt;/SPAN&gt; &lt;SPAN&gt;my problem&lt;/SPAN&gt; &lt;SPAN&gt;is similar, but&lt;/SPAN&gt; &lt;SPAN&gt;I could not&lt;/SPAN&gt; &lt;SPAN&gt;fix it.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/es-es/forums/intel-xdk/topic/562592"&gt;https://software.intel.com/es-es/forums/intel-xdk/topic/562592&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN&gt;Regards.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 09:18:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112053#M72694</guid>
      <dc:creator>Ismael_M_</dc:creator>
      <dc:date>2016-06-29T09:18:27Z</dc:date>
    </item>
    <item>
      <title>Hi Ismael,</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112054#M72695</link>
      <description>&lt;P&gt;Hi Ismael,&lt;/P&gt;

&lt;P&gt;Thank you for your interest in AppSecurityAPI.&lt;/P&gt;

&lt;P&gt;Self signed certificate feature is not supported by the AppSecurityAPI on the XDK Emulator, however there exists a workaround.&lt;/P&gt;

&lt;P&gt;In the link you provided, OHAD.B provides an explanation of how to enable this functionality on the XDK emulator for a specific server and how to correctly extract the public key for your server. Were you able to follow those examples?&lt;/P&gt;

&lt;P&gt;Are you able to provide a full code snippet so we can recreate the issue?&lt;/P&gt;

&lt;P&gt;thanks,&lt;/P&gt;

&lt;P&gt;Dennis.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 21:22:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112054#M72695</guid>
      <dc:creator>Dennis_F_Intel</dc:creator>
      <dc:date>2016-06-29T21:22:02Z</dc:date>
    </item>
    <item>
      <title>Hi Dennis,</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112055#M72696</link>
      <description>&lt;P&gt;Hi Dennis,&lt;/P&gt;

&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN&gt;Yes, I have&lt;/SPAN&gt; &lt;SPAN&gt;followed all the steps&lt;/SPAN&gt; &lt;SPAN&gt;to create&lt;/SPAN&gt; &lt;SPAN&gt;public key.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN&gt;This&lt;/SPAN&gt; &lt;SPAN&gt;is my&lt;/SPAN&gt; &lt;SPAN&gt;way to extract&lt;/SPAN&gt; &lt;SPAN&gt;the public key&lt;/SPAN&gt; &lt;SPAN&gt;certificate:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;OpenSSL&amp;gt; x509 -pubkey -noout -in Certificado_SSL.cer&lt;BR /&gt;
	-----BEGIN PUBLIC KEY-----&lt;BR /&gt;
	MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqEKrwux1Pbpk5l1UNq7NoG5An&lt;BR /&gt;
	usSvqShTxKtuO35dSq+s36nXiiycZRatcPODVlFsVgW+6Gujl59rEF4SjKHOzyoQ&lt;BR /&gt;
	L9j8NyM7nIXfMoFQwjFEfNiip74/lkLjTmzrKiQAvuP/TzRdLHie6TqrgdxAUPkK&lt;BR /&gt;
	mdKgwkD7p82G0M+NrwIDAQAB&lt;BR /&gt;
	-----END PUBLIC KEY-----&lt;/P&gt;

&lt;P&gt;This is the function complete:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;function PruebaHTTPS(){
	var options = { 'url':"https://81.45.78.242/Service1.asmx/Sincronizar", 'method':"POST", serverKey:"-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqEKrwux1Pbpk5l1UNq7NoG5An\nusSvqShTxKtuO35dSq+s36nXiiycZRatcPODVlFsVgW+6Gujl59rEF4SjKHOzyoQ\nL9j8NyM7nIXfMoFQwjFEfNiip74/lkLjTmzrKiQAvuP/TzRdLHie6TqrgdxAUPkK\nmdKgwkD7p82G0M+NrwIDAQAB\n-----END PUBLIC KEY-----" };
	intel.security.secureTransport.open(
	function (instanceID) {
		alert("Succeeded in open, instance id is: "+instanceID);
		var myInstanceID=instanceID;  
        intel.security.secureTransport.setHeaders(   
			function(){
				alert('Succeeded in setHeaderValue');
				intel.security.secureTransport.sendRequest(
					function(response){
						alert('Succeeded in sendRequest, response.responseBody = ' + response.responseBody);
					},
					function(errorObj){
						alert('Failed in sendRequest, code = '+errorObj.code+', message = '+errorObj.message);
					},
					{'instanceID':myInstanceID}
				);
			},
			function(errorObj){
				alert('Failed in setHeaderValue, code = '+errorObj.code+', message = '+errorObj.message);
			},
			{'instanceID':myInstanceID}
		);
	},
	function (errorObj) {
		alert('Failed in open, code = '+errorObj.code+', message = '+errorObj.message);
	},
	options
	);  
}&lt;/PRE&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 07:56:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112055#M72696</guid>
      <dc:creator>Ismael_M_</dc:creator>
      <dc:date>2016-06-30T07:56:36Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112056#M72697</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm getting timeout error when i try to open the url of your service, can you check that it is correct and accessible?&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;i don't get a response even in a browser.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Can you also detail for me the steps you took to generate the server key you use?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;

&lt;P&gt;Dennis.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2016 12:10:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112056#M72697</guid>
      <dc:creator>Dennis_F_Intel</dc:creator>
      <dc:date>2016-07-03T12:10:00Z</dc:date>
    </item>
    <item>
      <title>Hi DENNIS,</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112057#M72698</link>
      <description>&lt;P&gt;Hi DENNIS,&lt;/P&gt;

&lt;P&gt;The server has been shutdown at the weekeend.&lt;/P&gt;

&lt;P&gt;To extract public key from a server&lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;OL&gt;
	&lt;LI&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;/SPAN&gt;Download the certificate from the server URL (using browser go to the server’ URL, right click on the certificate (left side of the navigation bar), go to connection tab, click on certificate information, go to Details tab, copy to File, Next, Base 64 encoded x.509 (.cer), Next, c:\Certificado_SSL.cer, Save, Next and Finish).&lt;/LI&gt;
	&lt;LI&gt;Extract the public key from the certificate file using OpenSSL command line tool:&amp;nbsp; OpenSSL&amp;gt; x509 -pubkey -noout -in Certificado_SSL.cer&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Thank you so much.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 06:27:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112057#M72698</guid>
      <dc:creator>Ismael_M_</dc:creator>
      <dc:date>2016-07-04T06:27:19Z</dc:date>
    </item>
    <item>
      <title>Hi Ismael,</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112058#M72699</link>
      <description>&lt;P&gt;Hi Ismael,&lt;/P&gt;

&lt;P&gt;Please excuse me for the delay in response,&lt;/P&gt;

&lt;P&gt;There are a number of possible reasons for the error you are getting.&lt;/P&gt;

&lt;P&gt;AppSecurityAPI's Secure Transport API enforces a number of security policies.&lt;/P&gt;

&lt;P&gt;Looking at your certificate i can see two possible issues, it uses an obsolete cipher suite (SHA-1) and in addition the Host name on the certificate is different then the host name in the URL (you provide an IP address).&lt;/P&gt;

&lt;P&gt;Are you able to generate a new certificate for your web server that addresses these issues?&lt;/P&gt;

&lt;P&gt;Dennis.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 22:26:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-App-Security-API-Calling-a-web-service-in-a-server/m-p/1112058#M72699</guid>
      <dc:creator>Dennis_F_Intel</dc:creator>
      <dc:date>2016-07-07T22:26:00Z</dc:date>
    </item>
  </channel>
</rss>

