The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download | Blog | Stats
Personal tools

GnuTLS SSL Module Under Windows

From the makers of InspIRCd.

Jump to: navigation, search

Contents

Using the GnuTLS SSL Module Under Windows

Downloading a precompiled distribution

This is the preferred method of beginning, since gnutls may be rather difficult to build manually due to multiple dependencies. A precompiled GnuTLS library can be found here:

http://josefsson.org/gnutls4win/

Or, you can alternatively search for your own however you like.

Installing the precompiled GnuTLS binaries

Installation is pretty straightforward, so it won't be covered here. Just run the installer and follow the prompts. It is not necessary to install the source code.

But there is a problem! The library files that are provided with the GnuTLS binary are only compatible with the cygwin/mingw gcc compiler, and these will not work in a VC++ environment (we need .lib files for that), so the next step is to generate these.

Open a Visual Studio command prompt (2003 is opened by Start->Programs->Microsoft Visual Studio .NET 2003->Visual Studio .NET Tools->Visual Studio .NET 2003 Command Prompt, 20005 via Start->Programs->Microsoft Visual Studio 2005->Visual Studio Tools->Visual Studio 2005 Command Prompt)

(if you're scared by the command prompt and you've reached this point, you'd probably be better off downloading a precompiled module. :P) CD into your GnuTLS installation directory, into the 'bin' folder.

cd "\Program Files\GnuTLS-1.7.8\bin"

This is where we generate the .lib file for use in our VC++ environment. Using the LIB tool provided with the Visual C++ compiler we can generate a .lib file from a .def file (and as luck would have it one is provided with the GnuTLS binary!)

C:\Program Files\GnuTLS-1.7.8\bin>lib /def:libgnutls-13.def /nologo /machine:x86

With any luck, this should give you the following output:

Creating library libgnutls-13.lib and object libgnutls-13.exp

Now all that's left is copying these into your Visual C++ install directories. Copy the .lib file into VC\lib, and the files in GnuTLS-1.7.8\include into VC\include. C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib and/or C:\Program Files\Microsoft Visual Studio 8\VC\lib.

Compiling the GnuTLS module for InspIRCd

Now you can proceed as usual to compile the module along with the rest of InspIRCd! We've added the appropriate library name in the .cpp file for you so you don't need to specify any special options to the linker. Copy the m_ssl_gnutls.cpp file from src\modules\extra into src\modules, re-run configure (for it to generate the makefiles again), and if you're a command line freak, compile with nmake -f modules.mak.

With any luck your module will compile and can then be loaded into the IRCd just like in a *nix environment.