在 Adobe AIR 中显示消息之前,如何绕过或检测 SSL 证书?
“SSL 证书不受信任。” Adobe AIR 应用程序中出现对话框。 我怎样才能在这种情况发生之前发现它? (其实我想让我的应用程序绕过警告...)
请检查以下代码:
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);
}
非常感谢您的关注。
"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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的办法是“从源头”防止此错误。
对于您尝试访问的域,在服务器上安装了来自已知证书颁发机构的有效 SSL 证书。
我怀疑是否有任何有效的方法来抑制此错误
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