title: SignalR how to get client certificate when he connect to hub
body: <p>How can i get client certificate when he connect to the signalr Hub? My code look like this i read certificate from file and then trying to connect to the hub. I want to create certifate object on hub and read some information from it.</p>
  
  <p>Hub code:</p>
  
  <pre><code>public class ServerHub:Hub
  {
  
  
      public override Task OnConnectedAsync()
      {
          string connectionId = Context.ConnectionId;
          //get certificate ? `X509Certificate2 cert = new X509Certificate2(Certificate);`
          return base.OnConnectedAsync();
      }
  </code></pre>
  
  <p>Client code</p>
  
  <pre><code>string Certificate = @"C:\Users\StażCRM\Downloads\sample.cer";
              X509Certificate2 cert = new X509Certificate2(Certificate);
              string resultsTrue = cert.ToString(true);
  
              // Display the value to the console.
              Console.WriteLine(resultsTrue);
  
              // Get the value.
              string resultsFalse = cert.ToString(false);
  
              // Display the value to the console.
              Console.WriteLine(resultsFalse);
  
  
              this.id = id;
  
              HubConnection con = new HubConnectionBuilder().WithUrl("https://localhost:44375/ClinicServer",opt=&gt;opt.ClientCertificates.Add(cert)).Build();
              con.StartAsync().Wait();
  </code></pre>