当前位置: 首页 > 工具软件 > XIFF > 使用案例 >

关于xiff设置TLS安全连接

祝允晨
2023-12-01
/**全局变量*/
			private var _connection:XMPPTLSConnection;
			
			protected function button1_clickHandler(event:MouseEvent):void
			{

				
				_connection=new XMPPTLSConnection();
				_connection.username="";
				_connection.password="";
				_connection.server="";
				_connection.port=5222;
				_connection.resource="";

				_connection.config=new TLSConfig(TLSEngine.CLIENT);
				_connection.config.trustSelfSignedCertificates=true;
				_connection.config.ignoreCommonNameMismatch=true;
				_connection.tls=true;


				_connection.addEventListener(LoginEvent.LOGIN, onLoginSuccess);

				_connection.connect();

			}

			protected function onLoginSuccess(event:LoginEvent):void
			{

				var presence:Presence = new Presence;
//				presence.show=Presence.SHOW_CHAT;
				_connection.send(presence);

			}

 以上是xiff的类库通过TLS方式登录的过程,xiff3.0.0的版本没有很好的实现TLS,所以你要去官网的svn上面下载最新的代码,然后通过以上代码才能完成TLS登录过程

 

相关资料请查看:http://community.igniterealtime.org/thread/41568

 类似资料: