TLS 1.2 support Air Desktop Version-Flex SDK 4.5.1
hi all,
i new forum. working on air desktop application. salesforce announced going disable tls 1.0 protocol servers , supporting 1.1,1.2 of tls protocol. here test url can use test in air desktop : https://tls1test.salesforce.com/s/. have gone through of posts in forum , did not find similar post issue. found one, did not either :
i wrote below code test url. securesocket connection successful. urlrequest failing, because using tls 1.0 version connect server., since air app uses tls 1.0 protocol, handshake failing. found info in wireshark: tlsv1 record layer: alert (level: fatal, description: handshake failure)
my goal switch desktop client support tls 1.2 protocol. using flex sdk 4.5.1 version build application. can please me understand issue ?
- is there anyway configure tls version urlloader or urlrequest ?
- do need client certificate authenticate server tls 1.2 protocol ?
- will work if upgrade flex , air sdks, tried, did not work, not sure whatever have tried 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 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 );
}
]]>
chris.campbell nimitja please me docs or link or info ?
More discussions in AIR Development
adobe
Comments
Post a Comment