You are viewing limited content. For full access, please sign in.

Question

Question

lfConnection.Create over SSL/TLS

asked on August 13

Hello,

I am wondering if anyone has experience with connecting to Laserfiche server securely (over TCP 443) using LFConnection.Create() method. We thought that setting the Secure property to True would do the trick, but it didn't. The application reported time-out (at Create) as soon as port 80 was closed on the fw.

public static conn CreateConnectionObject(LFDatabase lfdb)
        {
            LFConnection conn = null;
	    
            conn = new LFConnection();
	    conn.UserName = "LFUser";
            conn.Password = "LFPass";
            conn.Shared = true;
            
            //Enables secure connection
            conn.Secure = true;

            try
            {
                conn.Create(lfdb);
                Console.WriteLine("Created connection to Laserfiche server (GUID={0})", conn.GUID);

            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception calling conn.Create(LFDB) : {0}", ex);
                throw;
            }

            return conn;
        }
 

Rewriting using RepositoryRegistration and Session is a better way. But we want to find out if we can make secured connection with LFConnection or not?

Any suggestion or tip is appreciated. Thank you.

0 0

Answer

SELECTED ANSWER
replied on August 14

I have not tested the code, but I think your issue may be in how you setup the LFServer object before the login.  I believe that the LFApplication.GetServerByName uses standard port 80 and possibly the LFApplication.GetSSLServerByName uses SSL port.  Worth a try.

                // Creates a new application object.
                LFApplication app = new LFApplication();
                // Finds the appropriate server.
                LFServer serv = null;
                if (bUseSSL)
                {
                    serv = (LFServer)app.GetSSLServerByName(sLFS);
                    serv.ConnectSecurely = bUseSSL;
                    serv.SSLPort = 443;
                } else
                {
                    serv = (LFServer)app.GetServerByName(sLFS);
                }

 

1 0
replied on August 14 Show version history

Thank you for the suggestion. This looks promising smiley. I will test this out and give an update soon. Have a nice weekend!

 

*UPDATE*

The codes worked perfectly. Only adjustment was to remove the 

serv.SSLPort=443. 

We got an "Permission Denied" when trying to set the SSLPort. It would be a problem with SSL is configured to listen on non standard port, but not in our case.

Thanks again.

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.