Reply
Thread Tools
Posts: 567 | Thanked: 2,965 times | Joined on Oct 2009
#1
I am looking for a C/C++ library I can use on the N900 where I can pass it a HTTPS URL (including being able to feed it form POST data) and get back whatever the result is as data (byte array, something like that). Ideally it should be something that's on the phone by default or something I can link statically or easily include with my own tool.

Not sure yet if I will be using QT or GTK for the eventual UI that will be written for this (not sure which will be easier to learn in the context of the N900 although I do have a copy of "C++ GUI Programming with Qt 4 (2nd Edition)" so maybe QT is the way to go for UI)
 

The Following User Says Thank You to jonwil For This Useful Post:
Halftux's Avatar
Posts: 862 | Thanked: 2,511 times | Joined on Feb 2012 @ Germany
#2
I don't understand what you would like to achieve but I guess you should go with openssl and libcrypto library.

QT 4.x is also using the openssl api. But I guess going directly with openssl you have more control.

I need to dig through the data on my hard drive, I should have an ssl analyser app in qt for the N900 somewhere.
 
Posts: 3,074 | Thanked: 12,960 times | Joined on Mar 2010 @ Sofia,Bulgaria
#3
what about https://curl.haxx.se/libcurl/ or https://wiki.gnome.org/action/show/P...direct=LibSoup
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

The Following 3 Users Say Thank You to freemangordon For This Useful Post:
Halftux's Avatar
Posts: 862 | Thanked: 2,511 times | Joined on Feb 2012 @ Germany
#4
What do you mean with POST data? Do you plan making a server and a client application for an own data stream exchange?

So here is a small sslinfo application in qt. I used it to find a bug in qt. Now for today I changed the output to stdout.

Code:
./sslinfo talk.maemo.org 443
Output is:

Code:
Connecting...

 === Peer Certificate ===
-----BEGIN CERTIFICATE-----
MIIF7zCCBNegAwIBAgIQHGREqRe6Erkwe9fnuOhMzzANBgkqhkiG9w0BAQsFADB4
MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEpMCcGA1UECxMg
U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxJjAkBgNVBAMTHVN0YXJ0
Q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AYLKwYBBAGBtTcBAgUwLTArBggrBgEFBQcCARYfaHR0cHM6Ly93
d3cuc3RhcnRzc2wuY29tL3BvbGljeTCCAQUGCisGAQQB1nkCBAIEgfYEgfMA8QB2
AGj2mPgfZIK+OozuuSgdTPxxUV1nk9RE0QpnrLtPT/vEAAABVkV3IrcAAAQDAEcw
RQIhAN74vMPTLZzhGlso7/Hyux5eUyvgYnuUtOvPziglhXKNAiBmB4C64IN5YTG8
xXdflzQ2/lr17jdBRnTafzBUr8ZjlwB3AKS5CZC0GFgUh7sTosxncAo8NZgE+Rvf
uON3zQ7IDdwQAAABVkV3IwUAAAQDAEgwRgIhALWCvtUHjWG+lg/M1Vf4RVVob8Sl
/2A70bwoX/HMqESWAiEAkyEYoM5KXIEnyGzVKQjBhbqCiRcQj5NTo80HcQAzhrUw
DQYJKoZIhvcNAQELBQADggEBAMefrV18BZLo/ecbHoETP0cO7wRO9gMkDLaXSiK5
3+jvoyVF7ZzeUdq7nZVohYmQhyvgneusn5CuL2OtefEQYVI6p2A32MIyYrpsx/sO
+IFdOQLndUGVfBwQUk/G4GSILM4HxR/hiwQf9lRcmfj+K9L/yf79xZyS/KF7q4Ij
2zUj4R8HfR5tYrARSmutS6NDaApijGS0wk/on4ITCHF8AW5TeHHbqw9nRGLN8mDT
0qfm8JEpnR3OTKudajHcc/tDUdfK9OZy31LvNH+1PVSHoQ2u/NUjo0+fQkS1Ns/V
/MAqwfq9mHhyMenfgOacsFwdt+TKlXjHsYHY3BCLOShPSgY=
-----END CERTIFICATE-----

== Subject Info ==
CommonName:		talk.maemo.org
Organization:		
LocalityName:		
OrganizationalUnitName:	
StateOrProvinceName:	
Alternate Subject Names (DNS):
talk.maemo.org
Alternate Subject Names (Email):

== Issuer Info ==
CommonName:		StartCom Class 1 DV Server CA
Organization:		StartCom Ltd.
LocalityName:		
OrganizationalUnitName:	StartCom Certification Authority
StateOrProvinceName:	

== Certificate ==
Effective Date:	        Mo. Aug 1 09:08:02 2016
Expiry Date:		Di. Aug 1 09:08:02 2017
Valid:			Yes

== Cipher ==
Authentication:	        RSA
Encryption:		AES(128)
Key Exchange:		DH
Cipher Name:		DHE-RSA-AES128-SHA
Protocol:		        SSLv3
Supported Bits:	        128
Used Bits:		        128

Done
I modified the source of sslinfo slightly. I know that there were other examples related to ssl connections and qt. It is worth to look at the origin source location.

The binary is for the N900.
Attached Files
File Type: gz sslinfo_binary.tar.gz (9.5 KB, 39 views)
File Type: zip sslinfo_source.zip (2.7 KB, 44 views)

Last edited by Halftux; 2017-02-23 at 22:09.
 
Posts: 567 | Thanked: 2,965 times | Joined on Oct 2009
#5
By "post data" I mean the data that gets sent when you have method="post" on a HTML form tag.

Right now I can do wget --post-file=post.txt https://blah and get back some JSON data. I want to do the same thing in code (generate the contents for the form post data, retrieve the URL and then get the results back)

What is going on on the other end doesn't matter, I just need a library that the N900 can use that can retrieve this data for me easily.

libsoup is in the repos but it has HTTPS turned off so that's not an option.
Using OpenSSL directly looks too complicated. I just want a simple library that does the work for me without needing to care about the SSL connection, certificates, https or anything else.

Last edited by jonwil; 2017-02-24 at 00:34.
 
Posts: 567 | Thanked: 2,965 times | Joined on Oct 2009
#6
Looks like the "easy API" for libcurl might be the way to go.
 

The Following User Says Thank You to jonwil For This Useful Post:
Posts: 567 | Thanked: 2,965 times | Joined on Oct 2009
#7
Have gotten libcurl working and now need to find something that can parse JSON data...
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 16:04.