How to create session with Solace Messaging tcp protocol being in orgnization vpn network.

Shambhu Member Posts: 3

Hi Team,

Session creation is failing while being in organization VPN. so tried with proxy settings as well given in

 but no luck. I tried with multiple debug.

string host = $"tcp://";
string username = "solace-cloud-client";
string vpnname = "solace1sttryout";
string password = "pflxxxxxxxxxxxxxxxxxxxqp";

      SessionProperties sessionProps = new SessionProperties()
         Host = host,
         VPNName = VPNName,
         UserName = UserName,
         Password = Password,
         ReconnectRetries = DefaultReconnectRetries,
         SSLValidateCertificate = false,
         //SSLClientCertificateFile = sslFile
     // Connect to the Solace messaging router
     Console.WriteLine("Connecting as {0}@{1} on {2}...", UserName, VPNName, host);
     using (ISession session = context.CreateSession(sessionProps, null, null))
         ReturnCode returnCode = session.Connect();
         if (returnCode == ReturnCode.SOLCLIENT_OK)
             Console.WriteLine("Session successfully connected.");
             Console.WriteLine("Error connecting, return code: {0}", returnCode);

tried with without proxy and with proxy both failed.

also tried but no luck.

string host = $"tcps://";


  • amackenzie
    amackenzie Member, Employee Posts: 240 Solace Employee

    Can you provide error messages for your various attempts?

  • Shambhu
    Shambhu Member Posts: 3
    edited August 18 #3

    @amackenzie , thanks for picking up the question, error is as below while debugging in

    Message=Failed to connect session
    at SolaceSystems.Solclient.Utils.Types.Utilities.GuardAgainstFailOrNotReady(ReturnCode returnCode, String message, Boolean includeSdkError, ISolLogger logger)
    at SolaceSystems.Solclient.Messaging.Native.SessionImpl.Connect()
    at Tutorial.TopicPublisher.Run(IContext context, String host) in C:\Users\zzu2kor\git source\ConsoleAppSample\SolaceMessaging\SolaceMessaging\Program.cs:line 86
    at Tutorial.TopicPublisher.Main(String[] args) in C:\Users\zzu2kor\OneDrive - Bosch Group\tryouts\git source\ConsoleAppSample\SolaceMessaging\SolaceMessaging\Program.cs:line 165

    This exception was originally thrown at this call stack:
    [External Code]
    Tutorial.TopicPublisher.Run(SolaceSystems.Solclient.Messaging.IContext, string) in Program.cs
    Tutorial.TopicPublisher.Main(string[]) in Program.cs

    program is taken from