I can't give you a total solution but > Well, I've called "SSLeay_version(SSLEAY_VERSION)" from lib, and I've got > "OpenSSL 0.9.8a 11 Oct 2005".
> That's confirm it's a version problem. My question now is, what shall I make > for removing all Openssl versions from my pc. After no OpenSSL installed or > compiled, then I will start from beginning with version 1.0.1. Exactly! Welcome to the club. A good number of the products one trials or purchases over the years install their own copy of the OpenSSL DLLs *somewhere*. Use the Windows Start search function and key in ssleay32.dll and/or libeay32.dll and see how many hits you get! You could start by uninstalling or deleting any products you are sure you are not using. (Don't just delete them all!) Perhaps that will solve the problem. Else, you are *probably* going to get the correct DLL if you put it right in the same folder with your .exe. Copy your DLLs from wherever you built them to wherever you are building your application. It's a little complicated with VS because of the multiple folders: project, Debug, and Release -- but play around and you should be able to get it right. You are in my experience on the right track using SSLeay_version(). I would leave it in my code and printf the results on every execution. You never know when someone is going to install *something* and mess you up. Good luck! Charles -----Original Message----- From: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] On Behalf Of Leonardo Laface de Almeida Sent: Thursday, October 18, 2012 5:57 AM To: openssl-users@openssl.org Subject: RES: Generating rsakey using openssl as lib Hi, >That doesn't prove it's finding the *correct* openssl. Most (and >usual) kinds of SSL connections work on older versions. Do you get >TLSv1.1 or TLSv1.2 connections, or at least request them properly even >if your server doesn't agree? That would prove version 1.0.1. My lib is server for SSL connections. >From "SSL_get_version(ssl)" after "SSL_accept(ssl)" I got the string: "TLSv1". I got this connection using a web browser. This means it is TLS 1.0, write? >Does your app run briefly and exit, or does/can it wait or do something >that takes a reasonably long time? If the latter, get ProcessExplorer >from technet.microsoft.com/en-us/sysinternals >and use it to examine your running application process to check the >full paths of the DLLs used. (Or there are other tools that can do >this, but ProcessExplorer is the one I am familar with.) The application runs and doesn't exit. The App starts trying to load mylib. Without those functions (EVP_PKEY_CTX*), the App loads mylib and uses properly all exported functions. With those functions, the App can't load mylib. Then, no function from lib can be called. I can debug mylib and App. From both the behavior is the same. >> I've downloaded the openssl*.tar file and extracted to >> C:/Openssl. Then, >> I've used Visual Studio 2010 for cross-compiling. >> I followed the instructions in INSTALL.W32 file (pretty good, >> by the way). >> >> Then, I've copied the following directories from "C:\Openssl\" to >> "C:\My_LIB_proj\lib\Openssl\": >> >> include >> lib >> >> Then, I've imported the libeay32.lib and ssleay32.lib as usual in c >> programming. I've also included >> "C:\My_LIB_proj\lib\Openssl\include" to >> included paths. >> >> Is something missing? >> >That should be good for compiling and linking your app. >Unless VS has changed recently, just adding an import .lib >to a project is used for linking but does *not* make it run >with the matching .dll, although other settings may do that. >(I'm back on 2003, and MS changes this kind of stuff a lot.) >Are you running your app in VS, or from CMD or similar? >That may also affect the search rules. >Note: this is not cross-compiling, just normal compiling. I'm using QT Creator for both, App and Mylib. In linux, I will use the same IDE. Lib Configuration: win32:LIBS += -L$$PWD/lib/Openssl/lib -llibeay32 win32:LIBS += -L$$PWD/lib/Openssl/lib -lssleay32 INCLUDEPATH += $$PWD/lib/Openssl/lib DEPENDPATH += $$PWD/lib/Openssl/lib INCLUDEPATH += $$PWD/lib/Openssl/include DEPENDPATH += $$PWD/lib/Openssl/include Note: $$PWD -> is path to "C:/mylib/" For testing, I have pointed mylib to "C:/Openssl/lib" (instead of "C:/MyLib/lib/Openssl/lib"). I've got the same behavior as above. --------------------------------------- Well, I've called "SSLeay_version(SSLEAY_VERSION)" from lib, and I've got "OpenSSL 0.9.8a 11 Oct 2005". That's confirm it's a version problem. My question now is, what shall I make for removing all Openssl versions from my pc. After no OpenSSL installed or compiled, then I will start from beginning with version 1.0.1. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org