03-04-2016 07:56 AM
Hi
I am not sur if I have understantd everything here. I want to do a simple HTTPS POST with the VI from the palette.
On the first page of the topic rolf you wrote that :
"The HTTP Cient VIs unter "Protocols/Data Communication/Http Client" in recent LabVIEW versions should be able to handle HTTPS just fine. You may have to add the according certificate to the connection before doing a request, if the site in question doesn't use a certificate that can be traced back to one of the preinstalled root certificates."
And it is exactly what I want to do
I have a certificate, I have followed these instruction to import it on my PC : http://windows.microsoft.com/en-us/windows/import-export-certificates-private-keys#1TC=windows-7
But when I put https in the url, the post VI give me this error :
Error 363507 occurred at LabVIEWHTTPClient.lvlib:POSTFile.vi:3390001
Possible reason(s):
LabVIEW: LabVIEW could not verify the authenticity of the server.
Complete call chain:
LabVIEWHTTPClient.lvlib:POSTFile.vi:3390001
Untitled 3
Do you have an idea of what can be the problem?
Thank you in avdance
Kevin
03-04-2016 08:08 AM
03-04-2016 08:11 AM
The HTTPS VIs do not make use of the standard Windows certificate store. This is quite understandable since they need to work on other platforms than Windows too. They are implemented using an independent SSL library, either the OpenSSL library or another one that NI might have purchased a license for. You will need to import the certificate directly into the session through the use of the Securty->ConfigSSL VI.
03-04-2016 08:32 AM
Thanks to both of you for your answer, Rolf, it was exactly what I was looking for
11-03-2022 12:24 PM - edited 11-03-2022 12:24 PM
@smercurio_fc wrote:
You'll need to search around on the net for an example on using .NET to do an HTTPS POST and then you should be able to duplicate the code in LabVIEW. A quick Google turned up this example: http://www.terminally-incoherent.com/blog/2008/05/05/send-a-https-post-request-with-c. Attached is a VI that tries to implement this, but I have no way of testing it, so you'll need to play around with it.
This saved me so much trouble thank you, sorry I could only give one kudo. That being said I do have an issue. I have times when my request will get sent back an error code, and in the body of the response there will be details of the error. What I am seeing is the LabVIEW error 1172 will be generated from the GetResponse Invoke Node with some details of what the error is. But the GetResponse reference will be null in the response. This means I can't read the body of the response to see the details of the error.
I know this is many years later, but is there a way to read the body of a response when there is an error? Alternatively has there been any improvement in sending HTTPS Post, or Get requests? I couldn't get the LabVIEW HTTP Client functions to work with the HTTPS address I was working with. Thanks again.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord