我使用Citrix的示例代码作为基础,并试图让它生成引导客户端使用其安全网关(CSG)提供程序的ICA文件。我的配置是将ICA文件的服务器地址替换为CSG票据,并且流量被强制转至CSG。如何将Citrix网站编码为使用安全网关(CSG)?
挑战在于Citrix App Server(即在1494上提供ICA会话)和CSG都必须通过Secure Ticket Authority(STA)进行协调。这意味着我的代码在创建ICA文件时需要与STA交谈,因为STA拥有CSG需要嵌入到ICA文件中的凭单。混乱?当然!但它更安全。
预CSG代码如下所示:
AppLaunchInfo launchInfo = (AppLaunchInfo)userContext.launchApp(appID, new AppLaunchParams(ClientType.ICA_30));
ICAFile icaFile = userContext.convertToICAFile(launchInfo, null, null);
我试图SSLEnabled信息到ICA一代,但它是不够的。下面是代码:
launchInfo.setSSLEnabled(true);
launchInfo.setSSLAddress(new ServiceAddress("CSG URL", 443));
现在,它看起来像我需要的时候配置我的农场注册的STA:
ConnectionRoutingPolicy policy = config.getDMZRoutingPolicy();
policy.getRules().clear();
//Set the Secure Ticketing Authorities (STAs).
STAGroup STAgr = new STAGroup();
STAgr.addSTAURL(@"http://CitrixAppServerURL/scripts/ctxsta.dll");
//creat Secure Gateway conenction
SGConnectionRoute SGRoute = new SGConnectionRoute(@"https://CSGURL");
SGRoute.setUseSessionReliability(false);
SGRoute.setGatewayPort(80);
SGRoute.setTicketAuthorities(STAgr);
// add the SGRoute to the policy
policy.setDefault(SGRoute);
这是基于代码我在Citrix Forums发现;然而,它打破了我与农场连接并获得我的应用程序列表的能力!
有人能告诉我一个有用的代码示例吗?还是参考文件?