websocket error : Error while connecting. Message: Unable to connect to the remote server

imzombie13
imzombie13 edited September 2020 in .Net API client
I am trying to connect to ticker from .Net API. But i am getting following error : websocket error : Error while connecting. Message: Unable to connect to the remote server on onError Function.

My Code is :
  Ticker ticker = new Ticker(MyAPIkey, MyAccessToken);

// Add handlers to events
ticker.OnTick += onTick;
ticker.OnOrderUpdate += OnOrderUpdate;
ticker.OnReconnect += onReconnect;
ticker.OnNoReconnect += oNoReconnect;
ticker.OnError += onError;
ticker.OnClose += onClose;
ticker.OnConnect += onConnect;

// Engage reconnection mechanism and connect to ticker
ticker.EnableReconnect(Interval: 5, Retries: 50);
ticker.Connect();

// Subscribing to NIFTY50 and setting mode to LTP
ticker.Subscribe(Tokens: new UInt32[] { 256265 });
ticker.SetMode(Tokens: new UInt32[] { 256265 }, Mode: Constants.MODE_LTP);
What is an issue ?
  • sujith
    Can you paste the complete stacktrace here?
  • imzombie13
    imzombie13 edited September 2020
    [0925/222752:ERROR:ssl_client_socket_nss.cc(1529)] handshake with server kite.zerodha.com:443 failed; NSS error code -12190, net_error -107

    This is the log. Thanks for your reply
  • tonystark
    tonystark edited September 2020
    handshake with server kite.zerodha.com:443 failed; NSS error code -12190, net_error -107
    This means there is a network issue that stops your client from connecting to our servers. Check if there is any firewalls or proxies in your network that is blocking access.
  • imzombie13
    no i turn off firewall and all secuity . I tried to run the same code on various machine (5 machines) no luck , always same error
  • imzombie13
    issue was not with port or proxies. MyAccessToken input was incorrect, which causes this error. Issue is resolved now
This discussion has been closed.