Skip to main content
Participant
November 12, 2015
Answered

TLS 1.2 support Air Desktop Version-Flex SDK 4.5.1

  • November 12, 2015
  • 1 reply
  • 4152 views

Hi All,

I am new to this forum. I am working on air desktop application. recently Salesforce announced they are going to disable TLS 1.0 protocol from their servers and they will be supporting 1.1,1.2 of TLS protocol. here is test url which we can use to test that in air desktop : https://tls1test.salesforce.com/s/.  I have gone through some of posts in this forum and did not find similar post about this issue. I found one, but it did not help either : Does FLEX and AIR support TLS 1.1+ encryption?


I wrote below code to test that url. SecureSocket connection is successful. but UrlRequest is failing, because it is using TLS 1.0 version to connect to server., Since Air app uses TLS 1.0 protocol, the handshake itself is failing. I found that info in wireshark:  TLSv1 Record Layer: Alert (Level: Fatal, Description: Handshake Failure)

My goal is to switch my desktop client to support TLS 1.2 protocol. I am using Flex SDK 4.5.1 version to build application. Can you please help me to understand about this issue ?

  1. Is there anyway to configure TLS version for UrlLoader or UrlRequest ?
  2. Do I need to get client certificate to authenticate with server for TLS 1.2 protocol ?
  3. Will this work if upgrade Flex and Air SDKs, I tried, it did not work, but not sure whatever i have tried is correct or not ?

  import flash.display.Sprite;

  import flash.events.*;

  import flash.net.URLLoader;

  import flash.net.URLRequest;

  import flash.net.URLRequestDefaults;

  import flash.net.URLRequestHeader;

  import flash.net.URLRequestMethod;

  import flash.net.URLVariables;

  private function URLRequestHeaderExample() {

   var loader:URLLoader = new URLLoader();

  loader.dataFormat = URLLoaderDataFormat.VARIABLES;

  configureListeners(loader);

  SecureSocketExample();

  var header:URLRequestHeader = new URLRequestHeader("Authorization", "sampleToken");

  var request:URLRequest = new URLRequest("https://tls1test.salesforce.com/services/oauth2/token"); //https://tls1test.salesforce.com/

  //request.data = new URLVariables("name=John+Doe");

  request.method = URLRequestMethod.GET;

  URLRequestDefaults.idleTimeout = 1200000;

  request.requestHeaders.push(header);

  try {

  loader.load(request);

  } catch (error:Error) {

  trace("Unable to load requested document.");

  }

  }

  private function configureListeners(dispatcher:IEventDispatcher):void {

  dispatcher.addEventListener(Event.COMPLETE, completeHandler);

  dispatcher.addEventListener(Event.OPEN, openHandler);

  dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);

  dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

  dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

  dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

  dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

  dispatcher.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, httpRespoStatusHandler);

  }

  private function completeHandler(event:Event):void {

  var loader:URLLoader = URLLoader(event.target);

  trace("completeHandler: " + loader.data);

  }

  private function openHandler(event:Event):void {

  trace("openHandler: " + event);

  }

  private function progressHandler(event:ProgressEvent):void {

  trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);

  }

  private function securityErrorHandler(event:SecurityErrorEvent):void {

  trace("securityErrorHandler: " + event);

  }

  private function httpStatusHandler(event:HTTPStatusEvent):void {

  trace("httpStatusHandler: " + event);

  }

  private function httpRespoStatusHandler(event:HTTPStatusEvent):void {

  trace("httpRespoStatusHandler: " + event);

  }

  private function ioErrorHandler(event:IOErrorEvent):void {

  trace("ioErrorHandler: " + event);

  }

  private var secureSocket:SecureSocket = new SecureSocket();

  private function SecureSocketExample()

  {

  secureSocket.addEventListener( Event.CONNECT, onConnect )

  secureSocket.addEventListener( IOErrorEvent.IO_ERROR, onError );

  try

  {

  secureSocket.connect( "tls1test.salesforce.com", 443 );

  }

  catch ( error:Error )

  {

  trace ( error.toString() );

  }

  }

  private function onConnect( event:Event 😞void

  {

  trace("Connected.");

  secureSocket.close();

  }

  private function onError( error:IOErrorEvent 😞void

  {

  trace( error.text + ", " + secureSocket.serverCertificateStatus );

  }

  ]]>

This topic has been closed for replies.
Correct answer chris.campbell

@kumarkasimala - What version of AIR are you using in your project?  If you can, could you verify the behavior with AIR 19.0.0.241?

Thanks,

Chris


@kumarkasimala

Our QA team has been able to reproduce this issue.  We're considering this a bug and will start work on fixing it for an upcoming release.  Our internal bug number for this is 4095988 in case you need to reference it later.


Thanks,

Chris

1 reply

Participant
November 16, 2015

chris.campbellnimitja‌ Could you please help me with any docs or link or any info ?

chris.campbell
Community Manager
Community Manager
November 16, 2015

I'll ask the team, but I believe AIR on Windows uses the network stack provided by Microsoft/IE.  Are you able to hit the same site using IE with TLS 1.2?

Participant
November 16, 2015

chris.campbell‌ Thanks for reply. Yes. After enabling TLS 1.1/1.2 from Internet options in IE, Adope air  Desktop client is connecting without any issues in windows because  air/flex sdk uses IE libraries to make ssl/tls calls.

But It is not working in MAC. It looks like it uses openssl client to make ssl/tls calls. Not sure what is happening with openssl.

It would be great helpful if you're team help with me any docs or info or solution..