Skip to content

Commit a0b56c4

Browse files
committed
Merge branch 'release-v0.9.0' into release
2 parents 37c4753 + 72ac2a0 commit a0b56c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+9069
-5767
lines changed

.travis.yml

+81-23
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,86 @@
11
language: rust
2-
sudo: false
3-
addons:
4-
apt:
5-
packages:
6-
- gcc-arm-linux-gnueabihf
7-
rust:
8-
- nightly
9-
- 1.9.0
10-
os:
11-
- osx
12-
- linux
2+
sudo: required
3+
rust: stable
4+
dist: trusty
5+
136
env:
14-
matrix:
15-
- TEST_FEATURES=false
16-
- TEST_FEATURES=true
7+
global:
8+
- TARGET=x86_64-unknown-linux-gnu
9+
- BUILD_OPENSSL_VERSION=1.0.1u
1710
matrix:
18-
# include:
19-
# - os: linux
20-
# env: TARGET=arm-unknown-linux-gnueabihf TEST_FEATURES=true
21-
# rust: 1.7.0
22-
exclude:
23-
- os: osx
24-
env: TEST_FEATURES=true
11+
include:
12+
# ARM-bit version compat
13+
- env: >
14+
TARGET=arm-unknown-linux-gnueabihf
15+
BUILD_OPENSSL_VERSION=1.0.2h
16+
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc
17+
QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf
18+
RUST_TEST_THREADS=1
19+
addons:
20+
apt:
21+
packages:
22+
- gcc-arm-linux-gnueabihf
23+
- qemu-user-static
24+
- libc6-dev-armhf-cross
25+
- binfmt-support
26+
- env: >
27+
TARGET=arm-unknown-linux-gnueabihf
28+
BUILD_OPENSSL_VERSION=1.1.0b
29+
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc
30+
QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf
31+
RUST_TEST_THREADS=1
32+
addons:
33+
apt:
34+
packages:
35+
- gcc-arm-linux-gnueabihf
36+
- qemu-user-static
37+
- libc6-dev-armhf-cross
38+
- binfmt-support
39+
40+
# Minimum version supported
41+
- rust: 1.9.0
42+
43+
# beta/nightly channels
44+
- rust: beta
45+
- rust: nightly
46+
47+
# 64-bit version compat
48+
- env: BUILD_OPENSSL_VERSION=1.0.2h
49+
- env: BUILD_OPENSSL_VERSION=1.1.0b
50+
51+
# 32-bit version compat
52+
- env: TARGET=i686-unknown-linux-gnu BUILD_OPENSSL_VERSION=1.0.1u
53+
addons:
54+
apt:
55+
packages:
56+
- gcc-multilib
57+
- env: TARGET=i686-unknown-linux-gnu BUILD_OPENSSL_VERSION=1.0.2h
58+
addons:
59+
apt:
60+
packages:
61+
- gcc-multilib
62+
- env: TARGET=i686-unknown-linux-gnu BUILD_OPENSSL_VERSION=1.1.0b
63+
addons:
64+
apt:
65+
packages:
66+
- gcc-multilib
67+
68+
# osx 32/64
69+
- os: osx
70+
env: TARGET=x86_64-apple-darwin
71+
- os: osx
72+
env: TARGET=i686-apple-darwin
73+
install: brew uninstall openssl && brew install openssl --universal
74+
75+
2576
before_install:
26-
- ./openssl/test/build.sh
77+
- ./openssl/test/build.sh
78+
- curl https://static.rust-lang.org/rustup.sh |
79+
sh -s -- --add-target=$TARGET --disable-sudo -y --prefix=`rustc --print sysroot`
2780
script:
28-
- ./openssl/test/run.sh
81+
- ./openssl/test/run.sh
82+
83+
cache:
84+
cargo: true
85+
directories:
86+
- $HOME/openssl

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[workspace]
2-
members = ["openssl", "openssl-sys"]
2+
members = ["openssl", "openssl-sys", "systest"]

README.md

+62-54
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,26 @@
22

33
[![Build Status](https://travis-ci.org/sfackler/rust-openssl.svg?branch=master)](https://travis-ci.org/sfackler/rust-openssl)
44

5-
[Documentation](https://sfackler.github.io/rust-openssl/doc/v0.8.3/openssl).
5+
[Documentation](https://sfackler.github.io/rust-openssl/doc/v0.9.0/openssl).
6+
7+
## Warning
8+
9+
This README does not correspond to rust-openssl 0.7.x. See
10+
[here](https://github.com/sfackler/rust-openssl/blob/b8fb29db5c246175a096260eacca38180cd77dd0/README.md)
11+
for that README.
612

713
## Building
814

9-
rust-openssl depends on both the OpenSSL runtime libraries and headers.
15+
rust-openssl depends on the OpenSSL runtime libraries version 1.0.1 or above.
16+
Currently the libraries need to be present in the build environment before this
17+
crate is compiled, and some instructions of how to do this are in the sections
18+
below.
1019

1120
### Linux
1221

13-
On Linux, you can install OpenSSL via your package manager. The headers are
14-
sometimes provided in a separate package than the runtime libraries - look for
15-
something like `openssl-devel` or `libssl-dev`.
22+
On Linux, you can typically install OpenSSL via your package manager. The
23+
headers are sometimes provided in a separate package than the runtime libraries
24+
- look for something like `openssl-devel` or `libssl-dev`.
1625

1726
```bash
1827
# On Ubuntu
@@ -23,79 +32,78 @@ sudo pacman -S openssl
2332
sudo dnf install openssl-devel
2433
```
2534

35+
If installation via a package manager is not possible, or if you're cross
36+
compiling to a separate target, you'll typically need to compile OpenSSL from
37+
source. That can normally be done with:
38+
39+
```
40+
curl -O https://www.openssl.org/source/openssl-1.1.0b.tar.gz
41+
tar xf openssl-1.1.0b.tar.gz
42+
cd openssl-1.1.0b
43+
export CC=...
44+
./Configure --prefix=... linux-x86_64 -fPIC
45+
make -j$(nproc)
46+
make install
47+
```
48+
2649
### OSX
2750

28-
OpenSSL 0.9.8 is preinstalled on OSX. Some features are only available when
29-
linking against OpenSSL 1.0.0 or greater; see below on how to point
30-
rust-openssl to a separate installation. OSX releases starting at 10.11, "El
31-
Capitan", no longer include OpenSSL headers which will prevent the `openssl`
32-
crate from compiling.
51+
Although OpenSSL 0.9.8 is preinstalled on OSX this library is being phased out
52+
of OSX and this crate also does not support this version of OpenSSL. To use this
53+
crate on OSX you'll need to install OpenSSL via some alternate means, typically
54+
homebrew:
3355

34-
For OSX 10.11 you can use brew to install OpenSSL and then set the environment variables
35-
as described below.
3656
```bash
3757
brew install openssl
38-
export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
39-
export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib
4058
```
4159

42-
May be necessary clean the repository with `cargo clean` before build again.
43-
44-
### Windows
60+
### Windows MSVC
4561

46-
On Windows, consider building with [mingw-w64](http://mingw-w64.org/).
47-
Build script will try to find mingw in `PATH` environment variable to provide
48-
Cargo with location where openssl libs from mingw-w64 package may be found.
62+
On MSVC it's unfortunately not always a trivial process acquiring OpenSSL.
63+
Perhaps the easiest way to do this right now is to download [precompiled
64+
binaries] and install them on your system. Currently it's recommended to
65+
install the 1.1.0b light installation if you're choosing this route.
4966

50-
mingw-w64 can be easily installed by using [MSYS2](http://msys2.github.io/). Install MSYS2 according to the instructions, and then, from an MSYS2 Shell, install mingw-w64:
67+
[precompiled binaries]: http://slproweb.com/products/Win32OpenSSL.html
5168

52-
32-bit:
53-
```bash
54-
pacman -S mingw-w64-i686-gcc
55-
```
69+
Once a precompiled binary is installed you can configure this crate to find the
70+
installation via an environment variable:
5671

57-
64-bit
58-
```bash
59-
pacman -S mingw-w64-x86_64-gcc
72+
```
73+
set OPENSSL_DIR=C:\OpenSSL-Win64
6074
```
6175

62-
and then install the mingw-w64 toolchain.
76+
After that, you're just a `cargo build` away!
6377

64-
32-bit:
65-
```bash
66-
pacman -S mingw-w64-i686-toolchain
67-
```
78+
### Windows GNU (MinGW)
6879

69-
64-bit:
70-
```bash
71-
pacman -S mingw-w64-x86_64-toolchain
72-
```
80+
The easiest way to acquire OpenSSL when working with MinGW is to ensure you're
81+
using [MSYS2](http://msys2.github.io) and to then execute:
7382

74-
Alternatively, install OpenSSL from [here][1]. Cargo will not be able to find OpenSSL if it's
75-
installed to the default location. You can either copy the `include/openssl`
76-
directory, `libssl32.dll`, and `libeay32.dll` to locations that Cargo can find
77-
or pass the location to Cargo via environment variables:
83+
```
84+
# 32-bit
85+
pacman -S mingw-w64-i686-openssl
7886
79-
```bash
80-
env OPENSSL_LIB_DIR=C:/OpenSSL-Win64 OPENSSL_INCLUDE_DIR=C:/OpenSSL-Win64/include cargo build
87+
# 64-bit
88+
pacman -S mingw-w64-x86_64-openssl
8189
```
8290

91+
And after that, a `cargo build` should be all you need!
92+
8393
### Manual configuration
8494

8595
rust-openssl's build script will by default attempt to locate OpenSSL via
86-
pkg-config. This will not work in some situations, for example, on systems that
87-
don't have pkg-config, when cross compiling, or when using a copy of OpenSSL
96+
pkg-config or other system-specific mechanisms. This will not work in some
97+
situations however, for example cross compiling or when using a copy of OpenSSL
8898
other than the normal system install.
8999

90100
The build script can be configured via environment variables:
91-
* `OPENSSL_LIB_DIR` - If specified, a directory that will be used to find
92-
OpenSSL runtime libraries.
93-
* `OPENSSL_INCLUDE_DIR` - If specified, a directory that will be used to find
94-
OpenSSL headers.
95-
* `OPENSSL_STATIC` - If specified, OpenSSL libraries will be statically rather
96-
than dynamically linked.
97101

98-
If either `OPENSSL_LIB_DIR` or `OPENSSL_INCLUDE_DIR` are specified, then the
99-
build script will skip the pkg-config step.
102+
* `OPENSSL_DIR` - If specified, a directory that will be used to find
103+
OpenSSL installation. It's expected that under this directory the `include`
104+
folder has header files and a `lib` folder has the runtime libraries.
105+
* `OPENSSL_STATIC` - If specified, OpenSSL libraries will be statically rather
106+
than dynamically linked.
100107

101-
[1]: http://slproweb.com/products/Win32OpenSSL.html
108+
If `OPENSSL_DIR` is specified, then the build script will skip the pkg-config
109+
step.

appveyor.yml

+35-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,45 @@
11
environment:
2-
OPENSSL_INCLUDE_DIR: C:\OpenSSL\include
3-
OPENSSL_LIB_DIR: C:\OpenSSL\lib
4-
OPENSSL_LIBS: ssleay32:libeay32
2+
SSL_CERT_FILE: "C:\\OpenSSL\\cacert.pem"
53
matrix:
6-
- TARGET: i686-pc-windows-gnu
7-
BITS: 32
8-
- TARGET: x86_64-pc-windows-msvc
9-
BITS: 64
4+
# 1.1.0, 64/32 bit
5+
- TARGET: i686-pc-windows-gnu
6+
BITS: 32
7+
MSYS2: 1
8+
OPENSSL_VERSION: 1_1_0b
9+
- TARGET: x86_64-pc-windows-msvc
10+
BITS: 64
11+
OPENSSL_VERSION: 1_1_0b
12+
OPENSSL_DIR: C:\OpenSSL
13+
14+
# 1.0.2, 64/32 bit
15+
- TARGET: x86_64-pc-windows-gnu
16+
BITS: 64
17+
MSYS2: 1
18+
OPENSSL_VERSION: 1_0_2j
19+
- TARGET: i686-pc-windows-msvc
20+
BITS: 32
21+
OPENSSL_VERSION: 1_0_2j
22+
OPENSSL_DIR: C:\OpenSSL
1023
install:
11-
- ps: Start-FileDownload "http://slproweb.com/download/Win${env:BITS}OpenSSL-1_0_2h.exe"
12-
- Win%BITS%OpenSSL-1_0_2h.exe /SILENT /VERYSILENT /SP- /DIR="C:\OpenSSL"
13-
- ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-1.9.0-${env:TARGET}.exe"
14-
- rust-1.9.0-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
15-
- SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin
16-
- SET PATH=%PATH%;C:\MinGW\bin
24+
# install OpenSSL
25+
- ps: Start-FileDownload "http://slproweb.com/download/Win${env:BITS}OpenSSL-${env:OPENSSL_VERSION}.exe"
26+
- Win%BITS%OpenSSL-%OPENSSL_VERSION%.exe /SILENT /VERYSILENT /SP- /DIR="C:\OpenSSL"
27+
- ps: Start-FileDownload "https://curl.haxx.se/ca/cacert.pem" -FileName "C:\OpenSSL\cacert.pem"
28+
29+
# Install Rust
30+
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
31+
- rustup-init.exe -y --default-host %TARGET%
32+
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
33+
- if defined MSYS2 set PATH=C:\msys64\mingw%BITS%\bin;%PATH%
1734
- rustc -V
1835
- cargo -V
1936

2037
build: false
2138

22-
# Don't run doctests due to rust-lang/cargo#1592
2339
test_script:
24-
- cargo test --lib --manifest-path openssl/Cargo.toml
40+
- cargo run --manifest-path systest/Cargo.toml --target %TARGET%
41+
- cargo test --manifest-path openssl/Cargo.toml --target %TARGET%
2542

43+
cache:
44+
- target
45+
- C:\Users\appveyor\.cargo\registry

openssl-sys/Cargo.toml

+2-28
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,21 @@
11
[package]
22
name = "openssl-sys"
3-
version = "0.7.17"
3+
version = "0.9.0"
44
authors = ["Alex Crichton <alex@alexcrichton.com>",
55
"Steven Fackler <sfackler@gmail.com>"]
66
license = "MIT"
77
description = "FFI bindings to OpenSSL"
88
repository = "https://github.com/sfackler/rust-openssl"
9-
documentation = "https://sfackler.github.io/rust-openssl/doc/v0.7.17/openssl_sys"
9+
documentation = "https://sfackler.github.io/rust-openssl/doc/v0.9.0/openssl_sys"
1010
links = "openssl"
1111
build = "build.rs"
1212

13-
[features]
14-
tlsv1_2 = []
15-
tlsv1_1 = []
16-
dtlsv1 = []
17-
dtlsv1_2 = []
18-
sslv2 = []
19-
sslv3 = []
20-
aes_xts = []
21-
aes_ctr = []
22-
npn = []
23-
alpn = []
24-
rfc5114 = []
25-
pkcs5_pbkdf2_hmac = []
26-
ecdh_auto = []
27-
hmac_clone = []
28-
2913
[dependencies]
3014
libc = "0.2"
3115

3216
[build-dependencies]
3317
pkg-config = "0.3"
3418

35-
[target.le32-unknown-nacl.dependencies]
36-
libressl-pnacl-sys = "2.1.0"
37-
[target.x86_64-unknown-nacl.dependencies]
38-
libressl-pnacl-sys = "2.1.0"
39-
[target.i686-unknown-nacl.dependencies]
40-
libressl-pnacl-sys = "2.1.0"
41-
[target.arm-unknown-nacl.dependencies]
42-
libressl-pnacl-sys = "2.1.0"
43-
44-
# Only here to make sure we link to these in a static build on Windows
4519
[target.'cfg(windows)'.dependencies]
4620
user32-sys = "0.2"
4721
gdi32-sys = "0.2"

0 commit comments

Comments
 (0)