C# and librets connectivity issue in login

55 views
Skip to first unread message

Dinu John

unread,
Jun 11, 2020, 10:25:00 PM6/11/20
to LibRets Mirror
Hi All,

I am integrating gsmls into my .net C# application using liberts library. However I am always getting below error/exception during login.

The same login credentials working fine in https://retsmd.com/
Also I have a retsconnector 1.2 client app which also autheticating perfectly using thecredentials.

Always getting below exception

Could not get URL [https://rets2.gsmls.com/rets_idx/login.do] - HTTP response code: 503 

Below is my code.

  try
            {
                string url = "https://rets2.gsmls.com/rets_idx/login.do";
                string userAgent = "RETS-Connector1.2_KurianSSeethakunn/1.0";
                string userName = "uname";
                string pass = "pass";

                var Session = new RetsSession(url);
                Session.SetUserAgent(userAgent);
                Session.SetUserAgentPassword("ua-pass");
                Session.SetUserAgentAuthType(UserAgentAuthType.USER_AGENT_AUTH_RETS_1_7);
                Session.SetRetsVersion(RetsVersion.RETS_1_5);
          
                bool loginResult = Session.Login(userName, pass);

                if (!loginResult)
                {
                    Console.WriteLine("\nLogin to RETS Failed at " + DateTime.Now);
                }
                else
                {
                    Console.WriteLine("\nLogin to RETS Succeeded at " + DateTime.Now);
                }

            }
            catch(Exception ex)
            {
                Console.Write(ex.Message);
            }

Can someone please help me getting this resolved?

Dinu John

unread,
Jun 11, 2020, 10:45:53 PM6/11/20
to LibRets Mirror
Hi All -
I got it resolved from another post here.
I added below line.

 if (url.Contains("https"))
                    Session.SetModeFlags(RetsSession.MODE_NO_SSL_VERIFY);
Reply all
Reply to author
Forward
0 new messages