How can I bypass or detect SSL Certificate before the message is shown in Adobe AIR?
"The SSL Certificate is not trusted." dialog occurs in Adobe AIR application. How can I detect this situation before it happens? (Actually I want my app to bypass the warning...)
Please check the following code:
var request:URLRequest = new URLRequest('http://bit.ly/dzKg2q');
request.followRedirects = true;
request.manageCookies = true;
request.useCache = true;
request.authenticate = false; 开发者_运维知识库// I set this as true, but it does not work either.
var loader:URLLoader = new URLLoader;
loader.addEventListener(Event.COMPLETE, function(event:Event):void {
trace('COMPLETE');
});
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function(event:Event):void {
trace('SECURITY_ERROR');
});
loader.addEventListener(IOErrorEvent.IO_ERROR, function(event:Event):void {
trace('IO_ERROR');
});
try{
loader.load(request);
}catch(e:SecurityError) {
trace(e);
}
Thank you very much for your attention.
Your best bet is to prevent this error "At the source".
Have a valid SSL Certificate from a known certificate authority installed on the server for the domain you are trying to access.
I doubt there is any valid way to suppress this error
精彩评论