Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

andresilva
New Contributor III

Upload Extension .Net C#

I'm trying to upload an extension to qlik sense so I'm using qrs service.

When I use http it works fine, but when I use https it tells me that the connection is not secure. What do I need to do on my server to give?


HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://xpto.com/qrs/extension/upload?privileges=true&pwd=&xrfkey=52xnyIGISMft5K08");

request.KeepAlive = true;

request.Accept = "application/json, text/plain, */*";

request.Headers.Add("X-Qlik-XrfKey", @"52xnyIGISMft5K08");

request.Headers.Add("Origin", @"https://xpto.com");

request.Headers.Set(HttpRequestHeader.AcceptLanguage, "en-US");

request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36";

request.ContentType = "application/vnd.qlik.sense.app";

request.Referer = "https://xpto.com/qmc/extensions";

request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br");

request.Headers.Set(HttpRequestHeader.Cookie, @"_ga=GA1.2.1411299651.1525424651; X-Qlik-Session="+ session);

request.Method = "POST";

request.ServicePoint.Expect100Continue = false;

string body = "<file binary>"

byte[] postBytes = Convert.FromBase64String(body);

request.ContentLength = postBytes.Length;

Stream stream = request.GetRequestStream();

stream.Write(postBytes, 0, postBytes.Length);

stream.Close();

Tags (5)
1 Reply
Highlighted
Employee
Employee

Re: Upload Extension .Net C#

Could it be a certificate validation issue? You can try to turn of the validation by setting the static property ServicePointManager.ServerCertificateValidationCallback like I do here:

https://github.com/kolsrud/qlik_rest_sdk/blob/master/Qlik.Sense.RestClient/RestClient.cs#L61