Search code examples
javaeclipsesessionssllotus-domino

How to get SSL Domino Session via DIIOP


I try to connect to a Domino Server with a remote Java application started from Eclipse. The Domino Server allows SSL connections only.

I try to get the session with the following code.

String[] arg = new String[1];
arg[0] = "-ORBEnableSSLSecurity";
String IOR = NotesFactory.getIOR(DOMINO_SERVER);
session = NotesFactory.createSessionWithIOR(IOR);

I get the following error message:

Could not get IOR from Domino Server: http:///diiop_ior.txt

I also checked if the URL works in a browser. If I put the URL in a browser I get the correct response from the server.

The TrustedCert.class from the Domino server is included in my Eclipse project.

Here some configuration details from the "diiopcfg.txt":

  • TCP Port: 0 Disabled
  • SSL Port: 63149 Enabled
  • Site TCP Name/Password Allowed: True
  • Site TCP Anonymous Allowed: False
  • Site SSL Name/Password Allowed: True
  • Site SSL Anonymous Allowed: False
  • Site Multi-Server Session Authentication: Disabled

[Update]

Enabled TCP Port 63148, now I get a session but cannot open a database. Error message NotesException: Database open failed () Only when I access the port directly I get a session object.

[Update 2]

Get the session now. Can't open the database. Error message: NotesException: Database ... has not been opened yet. If I use the "open" method of the Database object => Error message: Database open failed()

Database db = session.getDatabase(DOMINO_SERVER, DOMINO_DATABASE);
db.open();

ACL is correct, Maximum internet name and password = Reader

Any idea why the database could not be opened. Tried another database with the same result.


Solution

  • Try the following to connect to SSL.

    String args[] = new String[1]; 
    args[0] = "-ORBEnableSSLSecurity"; 
    Session s = NotesFactory.createSession(host, args, user, pwd); 
    

    Another method to connect:

    String args[] = new String[1];
    args[0] = "-HTTPEnableSSLSecurity";
    String ior = NotesFactory.getIOR(host,args);
    s = NotesFactory.createSessionWithIOR(ior, user, pwd);
    

    The variable host should just be the host name and nothing else. Your diiop_ior.txt needs to be visible on SSL though (so check that first).

    Alternatively you can try accessing the port 63148 directly. For example.

    s = NotesFactory.createSession( "server:63148", user, pwd);
    

    But this can move depending on server configuration.

    Lastly you can pull the DIIOP_IOR.txt and use it directly. Same issue as previous alternative though.