LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HTTPS POST

Highlighted
I'm trying to do a HTTP POST; however, the communication is HTTPS. I know that labview TCP doesn't support  HTTPS. But is there was way around this? Thank you!

-Than
0 Kudos
Message 1 of 24
(4,923 Views)
Highlighted
If you're on Windows you can use .NET or perhaps the Windows HTTP service via ActiveX.
0 Kudos
Message 2 of 24
(4,918 Views)
Highlighted

Hi, 

 

Can you elaborate a bit on how this can be done? I have never done anything with .NET before. Thanks!

 

- Dru

0 Kudos
Message 3 of 24
(4,447 Views)
Highlighted

Here is an example that might help get you started

 

=====================
LabVIEW 2012


0 Kudos
Message 4 of 24
(4,439 Views)
Highlighted

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.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 5 of 24
(4,429 Views)
Highlighted

Hi rolfk,

 

I want to further explain. I implemented the HTTP GET & POST utilizing this example: Example HTTP POST & GET

 

I had to modifiy the TCP Open VI though. Instead of opening a connection to the website I open a connection to our proxy server (it has a url). That made it all work since the proxy server looks at the GET & POST header for the information when using teh TCP write VI to write the entire unmodified post message.

 

But, I want to do HTTPS POST. I can't get into the VI's block diagrahm so I don't know what is going on in there and I can't force it to open a connection to the proxy server to send the POST message.

 

From my understanding of how the VI works the POST VI has a url input. This url input takes in both the URL & URI required for POST method. The data input is the body of the POST message. Am I correct in this understanding? If so, then there is no way to modify this to open a connection to the proxy server. Any possible solutions?

 

I have a certificate file for authentication. I assumed it was a CA certificate but if I need it for me (the client) to authenticate then it is a client certificate file, correct? If the latter is true then I have to go back and ask for the private key file to work with the SSL VI, correct?

 

Unless I can do SSL with the original Example using only the TCP VIs or possible how can I do a combination of the HTTP Client VIs and open a connection to the proxy server using the TCP Open VI's.

 

Please help with this. Thank you.

0 Kudos
Message 6 of 24
(4,423 Views)
Highlighted

You can't do that. SSL is a protocol that sits logically above TCP/IP and you can't infuse that into the LabVIEW TCP/IP VIs. So what you would have to do instead, is using an SSL API such as OpenSSL and communicate over that entirely when it is a HTTPS address. The HTTP Client VIs implement all this in a DLL and allow you to simply pass both HTTP and HTTPS requests to them. It is the most easy and simple way to handle both HTTP and HTTPS in LabVIEW transparently. .Net would be another option, but why bother.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 7 of 24
(4,412 Views)
Highlighted

Do you have any comment on me communicating with the proxy server through using the HTTP client VI's?

 

Any examples using OpenSSL API in LabVIEW?

0 Kudos
Message 8 of 24
(4,410 Views)
Highlighted

well, Open SSL is not really doable without additional C programming to go in between OpenSSL and LabVIEW. About Proxy support in the ClientVIs, I'm not really sure. My guess is that you would simply open the connection to the proxy server and add a header statement that tells the proxy server who to contact as real server. That would require the proxy server to be able to understand the necessary HTTP version to use that header statement.

 

An alternative is actually to install something like stunnel on your computer and use that as proxy server. stunnel can translate HTTP to HTTPS and reverse.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 9 of 24
(4,405 Views)
Highlighted

I guess you didn't read my earlier post. What you said is exactly what I did with the TCP VI's and teh proxy server.

 

Any examples on how to effective use stunnel and have it do the translation from HTTP to HTTPS with the client certificate file that I have. I have been searching but have been unable get a good enough understanding of what stunnel is and how to use it with LabVIEW. Blank statement of use this or that is hard for me to get going.

 

Thanks for your active participation. Much appreciated.

0 Kudos
Message 10 of 24
(4,400 Views)