On 10/17/07, D3||||!$ <[EMAIL PROTECTED]> wrote: > Hi!!! > > I am new to SSL programming: currently trying to "play" with it... :-) > > I'm having some problems with compiling the sample client-server > source code given on the Mozilla/NSS official site. > > I went through the code but found that it has been written using the > NSPR source files. I had both, the NSS+NSPR source package as well as > the binaries of the same. To make the things "idiot-proof", I put all > the .C/.CPP/.hs in a single large include folder and then including > it. I also included the libs, dlls & chks contained in the lib folder > of the NSS binaries package. I finally ended up with some 40+ linker > errors in the both, client_test.obj & server_test.obj & sslsamples.obj > files. This makes me suspect that I've not/erroneously included some > of the files necessary for compilation... > > Could you please tell me which files are required for the proper > compilation of the project? > > Also, if you could tell me which files are required to be included for > developing SSl applications(since before initializing NSS, NSPR has to > be iniatilized..), I'll be extremely glad. > > Another thing which I wanted to enquire was that some of the files > were .C while others were .CPP so what should I compile the source as: > as C code or as CPP code?
You should compile the source as C code. NSPR and NSS use GNU makefiles. The build instructions for NSS (including building NSPR) are at http://www.mozilla.org/projects/security/pki/nss/nss-3.11.4/nss-3.11.4-build.html. The most difficult part is to install the prerequisite GNU make and Unix utilities on your Windows machine. Fortunately Ben Smedberg's "MozillaBuild" package makes this real easy: http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#MozillaBuild So install MozillaBuild and run the start-msvc8.bat batch file. It'll start up a command shell running "bash". In bash, the command to set an environment variable "FOO" to 1 is export FOO=1 There is an alternative: use our binary distributions: https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.6.4/msvc6.0/WIN954.0_OPT.OBJ/nspr-4.6.4.zip https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_11_4_RTM/msvc6.0/WIN954.0_OPT.OBJ/nss-3.11.4.zip They were built using VC++ 6.0, but should work with VC++ 2005. Even if you don't use the binary distributions, they still provide a piece of useful information -- they only include the headers and libraries that you need to develop an SSL app with NSS/NSPR. You can also get this info from the build tree. NSPR headers you need are in mozilla/dist/WIN954.0_OPT.OBJ/include, except all the headers in mozilla/dist/WIN954.0_OPT.OBJ/include/md and the header mozilla/dist/WIN954.0_OPT.OBJ/include/private/primpl.h. NSS headers you need are in mozilla/dist/public/nss The libraries you need: Import libraries: nspr4.lib, plc4.lib, plds4.lib, nss3.lib, smime3.lib, ssl3.lib DLLs: nspr4.dll, plc4.dll, plds4.dll, nss3.dll, softokn3.dll, softokn3.chk, freebl3.dll, freebl3.chk, smime3.dll, ssl3.dll Note: the binary data files softokn3.chk and freebl3.chk are needed for using NSS in the FIPS mode. Wan-Teh _______________________________________________ dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto