SSL support for libcurl - c++

At the beginning I want to tell you that I download libcurl from main site (i.e http://curl.haxx.se/download.html )
And version called:
Win64 2000/XP x86_64 zip 7.40.0 binary SSL SSH Edward LoPinto
I'm working on MSVC 2013 ultimate x64
Okey, this package seems to have SSL support (it contains ssl libs )
Program compiling fine, but when i try to run some https site I have got:
Protocol "https" not supported or disabled in libcurl.
I think that it is disabled (because this package contains ssl support).
Question is:
How to enable SSL support in libcurl ?
I solve my problem by compiling libcurl on my own hand.
It may help other people:
MSVC 2013 - 64 bit - 7.41.0 + OPENSSL
download
scan

Related

VisualStudio: remote lib headers are not downloaded when working with Suse Enterprise Server 12 SP5

Problem
I've got an issue when developing c++ application in Visual Studio using Suse Enterprise Server 12 SP5 distribution as remote build machine. The main problem is caused by libxml2.
Error logs: Errors.img
In the beginning, Visual Studio notified me that it cannot find libxml. I checked directory containing those headers and found out that libxml wasn't downloaded when I tried to load remote headers.
Research
Before SLES, I was working with CentOS without problems. As I understand, Visual Studio loads headers from /usr/lib/, so I compared how those distributions store installed libs. I found out that in CentOS lib files are stored in "/usr/lib" directory, but SLES keep them mostly stored in "/lib or /lib64" directories. So, I downloaded libxml sources from https://gitlab.gnome.org/GNOME/libxml2/ .
NOTE: VS failed when tried to execute "make" command, so I tried just coping “include/libxml” folder from sources to “/usr/lib/ directory”.
After it, Visual Studio downloaded that lib and intellisence has stopped showing error: "Cannot find libxml". But I still get errors of libxml absence: Other errors.img
My question is what are ways to solve this problem? Maybe there exists any way to download /lib/ directory, or install this libxml to /usr/lib at start? Do libxml from CentOS will correctly work in SLES?
Thank you in advance!
After some tries, solution founded.
I installed openSuse instead of SLES, download all necessary libs and successfully get headers. By the way, c++ application which built on openSuse, could launch on SLES without any problem.

How to build SRP for Win32 with Visual Studio 2017?

I need to build Secure Remote Password protocol library (SRP/libsrp) for old project from 2010. I can't figure out how to build it for Win32.
I found this link with latest source code:
http://srp.stanford.edu/download.html
Version 2.1.2 was used in project. There is link for Win32-binaries, but it's dead.
So the only way to get binaries is to compile the source code.
In Win32\README was said to put OpenSSL includes and compiled libs in related folder (include, lib, etc.).
I can't figure out what version of OpenSSL should be used. On the web page was said something about patching version 1.0.0.0, but I used the latest version of OpenSSL.
Then it was said to open "srp_openssl.dsw" file (which is VC++ 6 Workspace) and rebuild everything to get binaries.
The result is hundreds of errors related to the obsolete language and related to the OpenSSL. Also need to take into account that OpenSSL changed library names.
So, is the only way - to use OpenSSL 1.0.0.0 and VC++ 6 to build SRP? Also, are there any binaries in the internet?

How to set up cross platform compliation for C++ (NetBeans in win7 and make in linux)

I would like to set up a gcc C++ project using my preferred editro NetBeans (since it works with gcc), that would depend on some external libraries. I want it to compile in NetBeans with gcc chain, and in production - using command line make under linux. Preferably, first create project in NetBeans and then modify something to accept it in Linux.
The libraries will be the same but located in different folders, so I need to separate include pathes for these, and during compile time correct pathes must be picked.
Also, I might need to use minor amount of conditional compilation, as under windows and linux some #include directives might or might not contain library sub-pathes.
Is there any useful guide how to make this happen?
Assuming you are developping with Netbeans on Win7 and you have a Linux machine (lets call it a server) accessible by TCP/IP with all packages proprely installed (gcc and you program depedencies).
You need to:
Add a Build Host in Netbeans Services and setup the ssh connection (you server needs deamon sshd active of course). Netbeans will seek for a toolchain. If everything worked out: this is your remote build host;
If you have all your packages installed on your linux server (I mean installed form the package manager), sources will be located in /usr/include and libraries in /usr/lib;
In your project properties, define a new profiles for your server application (choosing the proper build host) and resolve dependecies.
Then, when compiling for Win7 target use default profiles Netbeans created for you (build host is localhost) and when compiling for Linux target use new profiles you created (build host is your linux server).
To minimize conditional pre-porcessor codes when including, you just need to use relative paths and keep on Win7 the same file hierarchy for your dependencies that your linux server has.
Additionnaly, you can run on linux server development tools such has gprof and valgrind to check your work.
This should work easily.

how can I enable SSL in QT windows application?

Qt requires open ssl libraries to be installed on system. In debian / ubuntu when I install open ssl using apt everything works. But when I compile my application in windows, SSL features are not available I can verify this by executing
QSslSocket::supportsSsl()
How do I make it work in windows? I downloaded and installed open ssl from http://www.slproweb.com/products/Win32OpenSSL.html but it still returns false.
So after long time I figured what the problem is:
These 2 libraries need to be in same folder as your executable OR in windows system folder (system32 I think):
libeay32.dll
ssleay32.dll
You will find them in \bin of your OpenSSL folder, since I copied these 2 libs there it works
IMPORTANT: When deploying to client computers, it's also necessary to install vcredist package that was used to compile these .dll which may differ from vcredist package needed to run the application itself. vcredist version depends on version of the libraries.
You have to add OpenSSL lib in your project. In windows Qt doesn't come with OpenSSL lib. (I think it's a legal issue). You can find OpenSSL developer libs in URI you posted. If you are compiling against 32bit framework, what you need to download is Win32 OpenSSL v1.0.1e
This is what I have in my project.
QT += core gui network
win32{
LIBS += -LC:/OpenSSL-Win32/lib -lubsec
INCLUDEPATH += C:/OpenSSL-Win32/include
}
As you figured out already, you were missing dlls. Here is more information
Check what version of ssl you need with
QSslSocket::sslLibraryBuildVersionString();
For ssl 1.0.x (qt<5.12.4) you are likely missing libeay32.dll and ssleay32.dll.
For ssl 1.1.x (qt>=5.12.4) binary compatibility broke (qt 5.12.4 released), so you might need libssl-1_1.dll and libcrypto-1_1.dll, and its dependencies capi.dll and dasync.dll.

Error Creating SSL Context - Qt

I tried everything mentioned in this Question
but nothing worked.
The binary works fine on Windows 64-bit, but almost always shows the error
Error Creating SSL Context()
on Windows 32-bit. I tried the demo http client example.
At last, I found the solution. I was downloading dll's from a dll website. You need to take these libraries
- libeay32.dll
- libssl32.dll
- ssleay32.dll
from this website here Win32 OpenSSL v1.0.2 file for 32 bit if you are using MSVC++ compiler
After installation of the above binary, copy the above three dll's in the the directory containing your binary file.
I recommend this source for OpenSSL Windows binaries. These binaries have no external dependencies and tested with 32-bit and 64-bit Qt5.
Update: OpenSSL 1.0 and 1.1 are not binary- and API-compatible. As of Qt 5.12 (certainly 5.12.4) version 1.1 seems the default OpenSSL backend in Qt, although I hear it can be configured to keep using 1.0.
I'm testing this source for Windows OpenSSL 1.1 builds, no problems so far: https://bintray.com/vszakats/generic/openssl