Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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();

1 Reply
Øystein_Kolsrud
Employee
Employee

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