我尝试使用从 Eclipse 启动的远程 Java 应用程序连接到 Domino 服务器。 Domino 服务器仅允许 SSL 连接。
我尝试使用以下代码获取 session 。
String[] arg = new String[1];
arg[0] = "-ORBEnableSSLSecurity";
String IOR = NotesFactory.getIOR(DOMINO_SERVER);
session = NotesFactory.createSessionWithIOR(IOR);
我收到以下错误消息:
无法从 Domino 服务器获取 IOR:http:///diiop_ior.txt
我还检查了该 URL 在浏览器中是否有效。如果我将 URL 放入浏览器中,我会从服务器获得正确的响应。
Domino 服务器中的 TrustedCert.class 包含在我的 Eclipse 项目中。
以下是“diiopcfg.txt”中的一些配置详细信息:
- TCP 端口:0 已禁用
- SSL 端口:63149 已启用
- 允许的站点 TCP 名称/密码:True
- 允许站点 TCP 匿名:False
- 允许的站点 SSL 名称/密码:True
- 允许网站 SSL 匿名:False
- 站点多服务器 session 身份验证:已禁用
[更新]
启用了 TCP 端口 63148,现在我获得了 session ,但无法打开数据库。错误消息 NotesException: Database open failed () 只有当我直接访问端口时,我才会得到 session 对象。
[更新2]
立即获取 session 。无法打开数据库。 错误消息:NotesException:数据库...尚未打开。 如果我使用数据库对象的“open”方法=>错误消息:数据库打开失败()
Database db = session.getDatabase(DOMINO_SERVER, DOMINO_DATABASE);
db.open();
ACL 正确,最大互联网名称和密码 = Reader
知道为什么无法打开数据库吗?尝试了另一个数据库,结果相同。
最佳答案
尝试以下操作来连接到 SSL。
String args[] = new String[1];
args[0] = "-ORBEnableSSLSecurity";
Session s = NotesFactory.createSession(host, args, user, pwd);
另一种连接方法:
String args[] = new String[1];
args[0] = "-HTTPEnableSSLSecurity";
String ior = NotesFactory.getIOR(host,args);
s = NotesFactory.createSessionWithIOR(ior, user, pwd);
变量 host 应该只是主机名,没有其他内容。不过,您的 diiop_ior.txt 需要在 SSL 上可见(因此请先检查)。
或者您可以尝试直接访问端口 63148。例如。
s = NotesFactory.createSession( "server:63148", user, pwd);
但这可能会根据服务器配置而变化。
最后,您可以拉取 DIIOP_IOR.txt 并直接使用它。不过,问题与之前的替代方案相同。
关于java - 如何通过 DIIOP 获取 SSL Domino session ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20043007/