Build with OpenSSL on Windows

760 views
Skip to first unread message

lh...@cafex.com

unread,
Mar 26, 2014, 12:15:13 PM3/26/14
to discuss...@googlegroups.com
Hi,

is it possible to build WebRTC on Windows using OpenSSL rather than NSS? I have tried setting use_openssl=1 in my GYP_DEFINES (before running gclient sync), but that ultimately leads to a ninja build error in that there is no thirdparty\openssl directory:

Generating gyp files from GN...
Updating projects from gyp files...
gyp
: C:\dev\. . .\webrtc\trunk\third_party\openssl\openssl.gyp not found (cwd: C:\dev\. . .\webrtc)

Is some other configuration required? Do I need to provide OpenSSL myself?

I'm using the 3.50 branch.

thanks,
Leigh


--------------------

Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer.  Thank you.  CafeX Communications.

Jiayang Liu

unread,
Mar 26, 2014, 1:20:23 PM3/26/14
to discuss...@googlegroups.com
It should be. You need to edit the DEPS file: add these lines in the deps_os->"win" entry:

 "third_party/openssl":
      From("chromium_deps", "src/third_party/openssl"),

lh...@cafex.com

unread,
Mar 27, 2014, 12:32:57 PM3/27/14
to discuss...@googlegroups.com
Thanks Jiayang Liu - I'm getting closer...

I applied your suggested change to the trunk/DEPS file, and I also had to put the following in the deps_os->win section of chromium_deps/DEPS:

    "src/third_party/openssl":
     
"/trunk/deps/third_party/openssl@" + Var("openssl_revision"),

This got me to the point where gclient sync would pull down third_party/openssl. I got a bunch of "warnings treated as errors" when I tried to build, which I've suppressed by adding 'msvs_disabled_warnings' to my common.gypi.

I also had to add the following to the openssl.gyp file - without this openssl/o_str.c would try to include <strings.h>, which is not present on windows:

['OS=="win"', {
 
'defines': [
   
'OPENSSL_SYSNAME_WIN32',
 
],
}],

So now I have the following compile errors in openssl (I've edited this for brevity):

FAILED: ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\talk\base\libjingle.messagedigest.obj.rsp /c ..\..\talk\base\messagedigest.cc /Foobj\talk\base\libjingle.messagedigest.obj /Fdobj\talk\libjingle.cc.pdb
c
:\dev\. . .\webrtc\trunk\third_party\openssl\openssl\include\openssl\evp.h(1325) : error C2146: syntax error : missing ';' before identifier 'EVP_AEAD_CTX_seal'
c
:\dev\. . .\webrtc\trunk\third_party\openssl\openssl\include\openssl\evp.h(1325) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c
:\dev\. . .\webrtc\trunk\third_party\openssl\openssl\include\openssl\evp.h(1329) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c
:\dev\. . .\webrtc\trunk\third_party\openssl\openssl\include\openssl\evp.h(1348) : error C2146: syntax error : missing ';' before identifier 'EVP_AEAD_CTX_open'
c
:\dev\. . .\webrtc\trunk\third_party\openssl\openssl\include\openssl\evp.h(1348) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c
:\dev\. . .\webrtc\trunk\third_party\openssl\openssl\include\openssl\evp.h(1348) : error C2086: 'int ssize_t' : redefinition
c
:\dev\. . .\webrtc\trunk\third_party\openssl\openssl\include\openssl\evp.h(1325) : see declaration of 'ssize_t'
c
:\dev\. . .\webrtc\trunk\third_party\openssl\openssl\include\openssl\evp.h(1352) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
     
[exec] ninja: build stopped: subcommand failed.

Looks like the ssize_t type used in evp.h is undefined - I think there's probably a typedef that's hidden by an #ifdef somewhere. I'll keep digging...

Leigh

Pau Ceano

unread,
Mar 29, 2014, 10:29:17 AM3/29/14
to discuss...@googlegroups.com
Hi,

I am also trying to use OpennSSl in windows. I think you are going the right way trying to modify DEPS and gyp files and I am sorry I cannot help you there, I follow your work with interest.
In the midtime it may help you to know that compile webrtc with openssl modifying the .vcxproj files looks possible.
What I did is:

- Install OpenSSL (1.0.1f) binaries from its web in the system (in it's own folder).
- In the EXE project inlude the openssl libraries ssleay32MDd.lib libeay32MDd.lib
- In the EXE project include the define SSL_USE_OPENSSL

- In the libjingle project include the defines SSL_USE_OPENSSL and HAVE_OPENSSL_SSL_H
Actually I did a grep and added SSL_USE_OPENSSL to all .vcxproj, this was rather brute but perhaps the define has to be in some other project and I didn't think it could harm.

Rebuild everything.

Doing this I could see that     talk_base::InitializeSSL(NULL); and talk_base::InitializeSSLThread(); do something reasonal and without errors.
Anyway I am still trying to setup a SCTP data channel (this was the reason to use OpenSSL) and still does not work.

best,
Pau

Reply all
Reply to author
Forward
0 new messages