The Windows build of Emacs 24.5 doesn’t ship with SSL and TLS support out of the box. Normally that’s not that much of a problem until you are trying to access marmalade-repo or have org2blog talk to your own blog via SSL/TLS.

Adding SSL and TLS support to the Windows builds of Emacs is easy. SSL/TLS support in the official Emacs build for Windows isn’t enabled because it doesn’t ship with the necessary support libraries, but you can get pre-built binaries from the ezwinports project on Sourceforge. Installation is simple – grab the desired binaries (I used gnutls, but there’s also an older openssl build available) and extract them into the root directory of your Emacs install. The directory layout is the same and mimics the standard Unix directory layout so everything ends up in the correct place.

After the next restart of Emacs, a quick

M-: (gnutls-available-p)

should result in ‘t’, showing you that Emacs has found the gnutls binaries. All of a sudden, org2blog can talk to my blog again and I’m finally set up the same way I am on the other OSs I use.

ezwinports has a whole bunch of other useful libraries available as well, like libpng, so check it out.

One caveat – the ezwinports libraries are 32 bit libraries so they work fine with the official 32 bit build of Emacs for Windows, but you need to look into alternatives if you use a 64 bit build.

5 thoughts on “Adding TLS support to Emacs 24.5 on Windows

    1. Thanks for the link, I wasn’t aware of their existence. Have you tried them with the current Emacs release?

      My personal preference is to use gnutls when I can in light of the recent openssl vulnerabilities, but it’s always good to know about alternatives.

      1. I use those OpenSSL binaries on the latest git version of Emacs (25.0..50.1) compiled for Windows, but I have to add that I compile Emacs myself. So that’s kind of cheating 🙂
        Do you maybe know how to check (using Lisp) which SSL/TLS libraries Emacs dynamically loads/uses ? Thanks in advance,

        Peter

        1. To answer my own question: Use the variable `tls-program`: “List of strings containing commands to start TLS stream to a host. Each entry in the list is tried until a connection is successful.”. You can use gnutls or openssl there.

          The variable `dynamic-library-alist` holds a list of DLLs: “Emacs tries to load the library from the files in the order they appear on the list; if none is loaded, the running session of Emacs won’t have access to that library.”

          If you want to use Emacs and gnutls on Windows (64 bit), that comes in a handy package on MSYS, which can be installed using ` pacman -Sy mingw-w64-x86_64-gnutls`. After that, the gnutls libraries (libgnutls-30.dll) can be found under `/mingw64/bin/`. See for more information on compiling Emacs (64 bit) on Windows the page https://www.onwebsecurity.com/windows/compiling-emacs-25-1-for-windows-using-msys2-and-mingw64

          Hope this helps anyone,

          Peter

Leave a Reply