title: C# telegram bot getting " a call to SSPI failed " error
body: <p>SO Im creating my first Telegram bot using C# here is my code:</p>
  
  <pre><code>using System;
  using System.Net;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Threading;
  using System.Windows.Forms;
  
  namespace k4rn46ebot{
  public partial class Form1 : Form
  {
  
      private static string TOKEN = "";
      private Thread botThread;
      Telegram.Bot.TelegramBotClient bot;
      public Form1()
      {
          InitializeComponent();
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
  
      }
  
      private void btnstart_Click(object sender, EventArgs e)
      {
          TOKEN = ttoken.Text;
          botThread = new Thread(new ThreadStart(runBot));
          botThread.Start();
      }
      void runBot() {
          bot = new Telegram.Bot.TelegramBotClient(TOKEN);
          this.Invoke(new Action(() =&gt;
          {
              lblstatus.Text = "Online";
              lblstatus.ForeColor = Color.Green;
          }));
          int offset = 0;
          while (true)
          {
              Telegram.Bot.Types.Update[] update = bot.GetUpdatesAsync(offset).Result;
              foreach (var up in update)
              {
                  offset = up.Id + 1;
                  if (up.Message == null)
                  {
                      continue;
                  }
                  var message = up.Message.Text.ToLower();
                  var from = up.Message.From;
                  var chatid = up.Message.Chat.Id;
  
                  if (message.Contains("/start"))
                  {
                      StringBuilder sb = new StringBuilder();
                      sb.AppendLine(from.Username + "welcome to K4RN46E BOT");
                      bot.SendTextMessageAsync(chatid, sb.ToString());
                  }
              }
          }
      }
  
      private void Form1_FormClosing(object sender, FormClosingEventArgs e)
      {
          botThread.Abort();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I'm getting the following error: "an unhandled exception of type 'system.aggregateexception' occurred in mscorlib.dll" error on line:Telegram.Bot.Types.Update[] update = bot.GetUpdatesAsync(offset).Result;</p>
  
  <p>In the event tab of MS Visual Studio 2015 
  I'm getting: "Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.dll ("A call to SSPI failed, See inner exception.")" and the inner exception says:"Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.dll ("A call to SSPI failed, See inner exception.")" too.</p>
  
  <p>Can anyone explain why I might be getting this error and what should I do to fix it?
  this is my event windows:
  <a href="https://i.stack.imgur.com/BwLdN.png" rel="nofollow noreferrer">MS Viasual Studio 2015 Events</a></p>