From 76f1386e7e80a774d9fb0aa3a5be5cf2b7437da5 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Tue, 9 Sep 2014 22:46:19 -0700 Subject: [PATCH 1/3] Add build and testing instructions to the readme Important: Windows dependencies and running test OpenSSL server --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 7c254097..7781aa81 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,34 @@ rust-openssl [![Build Status](https://travis-ci.org/sfackler/rust-openssl.svg?br ============ See the [rustdoc output](http://www.rust-ci.org/sfackler/rust-openssl/doc/openssl/). + +Building +-------- + +rust-openssl needs to link against the OpenSSL devleopment libraries on your system. It's very easy to get them on Linux. +For some reason, the OpenSSL distribution for Windows is structured differently, so it's a little more involved, but it *is* possible to build rust-openssl successfully on Windows. + +###Linux + +1. Run `sudo apt-get install libssl-dev`. +2. Run `cargo build` and optionally `cargo test`. + +###Windows + +1. Grab the latest Win32 OpenSSL installer [here][1]. At the time of this writing, it's v1.0.1i. If you're using 64-bit Rust (coming to Windows soon), then you should get the Win64 installer instead. +2. Run the installer, making note of where it's installing OpenSSL. The option to copy the libraries to the Windows system directory or `[OpenSSL folder]/bin` is your choice. The latter is probably preferable, and the default. +3. Navigate to `[OpenSSL folder]/lib/MinGW/`, and copy `libeay32.a` and `ssleay32.a` (If 64-bit, then they will have `64` instead of `32`.) to your Rust install's libs folder. The default should be: + * 32-bit: `C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib` + * 64-bit: TODO +4. Rename `libeay32.a` and `ssleay32.a` to `libcrypto.a` and `libssl.a`, respectively. +5. `cargo build` and optionally `cargo test`. + +###Testing +Several tests expect a local test server to be running to bounce requests off of. It's easy to do this. Open a separate terminal window and `cd` to the rust-openssl directory. Then run one of the following commands: + +* Windows: `openssl s_server -accept 15418 -www -cert test/cert.pem -key test/key.pem > NUL` +* Linux: `openssl s_server -accept 15418 -www -cert test/cert.pem -key test/key.pem >/dev/null` + +Then in the original terminal, run `cargo test`. If everything is set up correctly, all tests should pass. You might get some warnings in the `openssl s_server` window. Those aren't anything to worry about. You can stop the server using Control-C. + +[1]: http://slproweb.com/products/Win32OpenSSL.html From 5e6885af0116d549493bba46a45094e2d98308ce Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Tue, 9 Sep 2014 22:55:52 -0700 Subject: [PATCH 2/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7781aa81..1376d67e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ For some reason, the OpenSSL distribution for Windows is structured differently, ###Linux 1. Run `sudo apt-get install libssl-dev`. -2. Run `cargo build` and optionally `cargo test`. +2. Run `cargo build`. ###Windows @@ -22,7 +22,7 @@ For some reason, the OpenSSL distribution for Windows is structured differently, * 32-bit: `C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib` * 64-bit: TODO 4. Rename `libeay32.a` and `ssleay32.a` to `libcrypto.a` and `libssl.a`, respectively. -5. `cargo build` and optionally `cargo test`. +5. `cargo build`. ###Testing Several tests expect a local test server to be running to bounce requests off of. It's easy to do this. Open a separate terminal window and `cd` to the rust-openssl directory. Then run one of the following commands: From 68937102b022b20e5d4ce39ae5998ca20bc95f43 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Tue, 9 Sep 2014 22:56:05 -0700 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1376d67e..56f94a06 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ For some reason, the OpenSSL distribution for Windows is structured differently, * 32-bit: `C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib` * 64-bit: TODO 4. Rename `libeay32.a` and `ssleay32.a` to `libcrypto.a` and `libssl.a`, respectively. -5. `cargo build`. +5. Run `cargo build`. ###Testing Several tests expect a local test server to be running to bounce requests off of. It's easy to do this. Open a separate terminal window and `cd` to the rust-openssl directory. Then run one of the following commands: