4 Replies Latest reply: Nov 18, 2016 2:40 AM by Mattias Wennmo RSS

    Unable to connect with hub using DotNet SDK with Certificate.

    Abrar Ansari

      I am working with Dot Net window application, I need to get app list.

      I am trying to connect with Qlik server  using Dot Net SDK and the approach I am following is using certificate.

      But my code is giving error. I am using default virtual proxy.


      Note: 1. Same certificate I am using to get QlikTicket successfully.

              2. I am able to get data from Qlik Server using Dot Net SDK when I am using AsStaticHeaderUserViaProxy() for different virtual                    proxy.

              3. Why I am not using AsStaticHeaderUserViaProxy(), because I do not want to create another virtual proxy with different header              setting.




                      Uri uri = new Uri("https://ip-address:443");


                      ILocation location = Qlik.Engine.Location.FromUri(uri);


                      X509Certificate2 x509 = new X509Certificate2();

                      byte[] rawData = ReadFile(@"E:\Projects\Qlick\QlikSenseSDK1\Certificate\client.pfx");

                      x509.Import(rawData, "password@123", X509KeyStorageFlags.UserKeySet);

                      X509Certificate2Collection certificateCollection = new X509Certificate2Collection(x509);


                      location.AsDirectConnection("UserDirectory", "UserId", certificateCollection: certificateCollection);

                      location.VirtualProxyPath = "virproxy";


                      using (IHub hub = location.Hub())  //Error on this line


                          string test = "QV Product: " + hub.QTProduct() +

                           "  Product Version: " + hub.ProductVersion() +

                           "  OS Name:    " + hub.OSName() +

                           "  OS Version: " + hub.OSVersion();




      Error Message:

        The remote certificate is invalid according to the validation procedure.