Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jp_golay
Partner - Creator II
Partner - Creator II

Hi I Try to connect with .NET sdk

Hi I Try to connect with .NET sdk to a sense server and get this error (same as from a browser)

"The remote certificate is invalid according to the validation procedure."

Here the cod

private void btConnectServer_Click(object sender, EventArgs e) {

            try {

                Uri uri = new Uri("https://qsense.jp.com:4747");

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

                qsLocation.AsNtlmUserViaProxy();

               

                IHub qsHub = qsLocation.Hub();

                lbQsVersion.Text = qsHub.QvVersion();

            } catch (SocketException sex) {

                EbiUtils.MessageError(sex, "btConnectLocal_Click");

            } catch (Exception ex) {

                EbiUtils.MessageError(ex, "btConnectLocal_Click");

            } finally {

            }

        }

e

ebiexperts CTO
With WIP, Control everything!
Qlik Sense, QlikView and NPrinting Source control, Versioning and Deployment, Agile Lifecycle Management
7 Replies
Not applicable

You need to have a valid certificate on the server (not self signed) to be able to connect using https. For development environment I would suggest that you allow http connections to your server.

jp_golay
Partner - Creator II
Partner - Creator II
Author

If I use Http and port 4248 for login I get this error

The handshake failed due to an unexpected packet format.

private void btConnectServer_Click(object sender, EventArgs e) {

            try {

                Uri uri = new Uri("http://qsense.jp.com:4248");

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

                IHub qsHub = qsLocation.Hub();

                lbQsVersion.Text = qsHub.QvVersion();

            } catch (SocketException sex) {

                EbiUtils.MessageError(sex, "btConnectLocal_Click");

            } catch (Exception ex) {

                EbiUtils.MessageError(ex, "btConnectLocal_Click");

            } finally {

            }

        }

ebiexperts CTO
With WIP, Control everything!
Qlik Sense, QlikView and NPrinting Source control, Versioning and Deployment, Agile Lifecycle Management
jp_golay
Partner - Creator II
Partner - Creator II
Author

Is it possible to have help on this issue very annoying

Now i found that port is 4747 and set  qsLocation.AsNtlmUserViaProxy(false); to get authenticatred by http

And I get

QlikConnection "Open" timed out

For the server it self and from a client outside the server

I set the proxy whitelist

What to do to connect the server I passed 3 days and no success is that api tested ???

ebiexperts CTO
With WIP, Control everything!
Qlik Sense, QlikView and NPrinting Source control, Versioning and Deployment, Agile Lifecycle Management
Not applicable

If you connect to a server you usually dont need to specify the port.

Packet format errors are most certain due to trying to access https content through http or viceversa.

Dont forget to activly specify thats it is a http connection when you define the authentication mechanism for the location.

The API is tested, perhaps the errors could be better in describing the real problem.

konrad_mattheis
Luminary Alumni
Luminary Alumni

Hi,

I can say to you that the API is tested, but I started developing with a local sense installation. For local just write: 

var location = Location.Local;

location.AsDirectConnectionToPersonalEdition();

var hub = location.Hub();

That's all when you can start to play. If you like to use a remoteconnection you have to use the URI ws:// -> ws for WebSockets, but the authentification in the new Server is my eyes a little bit tricky. So start local and if everything is running fine go to the next step.

bye

Konrad

amien
Specialist
Specialist

Have you ever solved this issue? Can you share?

Øystein_Kolsrud
Employee
Employee

You could try to use the "cetificateValidation:false" on the connection setup (LocationExtensions.AsNtlmUserViaProxy‌), but it might be better to investigate why the certificates give the error. A typical scenario for why the "invalid according to" warning is returned is that there is a mismatch between the url of the certificates and the url used for connecting. There is a similar thread on this topic here: Unable to connect with hub using DotNet SDK with Certificate.