Эх сурвалжийг харах

Use rustls rather than openssl

Paul Lietar 8 жил өмнө
parent
commit
baf2b65d7b

+ 2 - 4
.travis.yml

@@ -13,11 +13,10 @@ matrix:
 addons:
   apt:
     packages:
-      - libprotoc-dev
-      - portaudio19-dev
-      - libpulse-dev
       - gcc-arm-linux-gnueabihf
       - libc6-dev-armhf-cross
+      - libpulse-dev
+      - portaudio19-dev
 
 before_script:
     - mkdir -p ~/.cargo
@@ -28,7 +27,6 @@ before_script:
 script:
     - cargo build --no-default-features --features "with-syntex"
     - cargo build --no-default-features --features "with-syntex with-tremor"
-    - cargo build --no-default-features --features "with-syntex facebook"
     - cargo build --no-default-features --features "with-syntex portaudio-backend"
     - cargo build --no-default-features --features "with-syntex pulseaudio-backend"
     - cargo build --no-default-features --features "with-syntex alsa-backend"

+ 71 - 99
Cargo.lock

@@ -10,6 +10,7 @@ dependencies = [
  "eventual 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "hyper 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hyper-rustls 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "json_macros 0.3.1 (git+https://github.com/plietar/json_macros)",
  "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "libpulse-sys 0.0.0 (git+https://github.com/astro/libpulse-sys)",
@@ -19,7 +20,6 @@ dependencies = [
  "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "mdns 0.2.0 (git+https://github.com/plietar/rust-mdns)",
  "num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "portaudio 0.2.0 (git+https://github.com/mvdnes/portaudio-rs)",
  "protobuf 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "protobuf_macros 0.6.0 (git+https://github.com/plietar/rust-protobuf-macros)",
@@ -27,6 +27,7 @@ dependencies = [
  "rpassword 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustls 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 0.8.21 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_codegen 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -79,6 +80,11 @@ dependencies = [
  "syntex_syntax 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "base64"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
 [[package]]
 name = "bit-set"
 version = "0.4.0"
@@ -127,8 +133,6 @@ name = "cookie"
 version = "0.2.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -190,15 +194,6 @@ name = "gcc"
 version = "0.3.41"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "gdi32-sys"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "getopts"
 version = "0.2.14"
@@ -228,8 +223,6 @@ dependencies = [
  "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
  "solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -239,6 +232,16 @@ dependencies = [
  "url 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "hyper-rustls"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "hyper 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustls 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "webpki-roots 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "idna"
 version = "0.1.0"
@@ -319,14 +322,6 @@ dependencies = [
  "protobuf 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "libressl-pnacl-sys"
-version = "2.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "pnacl-build-helper 1.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "linear-map"
 version = "1.1.0"
@@ -536,62 +531,11 @@ dependencies = [
  "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "openssl"
-version = "0.7.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.7.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys-extras 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "openssl-sys"
-version = "0.7.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "openssl-sys-extras"
-version = "0.7.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.7.17 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "openssl-verify"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "pkg-config"
 version = "0.3.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "pnacl-build-helper"
-version = "1.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "portaudio"
 version = "0.2.0"
@@ -704,6 +648,15 @@ name = "regex-syntax"
 version = "0.3.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "ring"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "untrusted 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "rpassword"
 version = "0.3.0"
@@ -740,6 +693,19 @@ dependencies = [
  "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "rustls"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "base64 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ring 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
+ "untrusted 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "webpki 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "scoped-tls"
 version = "0.1.0"
@@ -974,14 +940,6 @@ dependencies = [
  "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "tempdir"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "tempfile"
 version = "2.1.4"
@@ -1106,6 +1064,11 @@ name = "unicode-xid"
 version = "0.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "untrusted"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
 [[package]]
 name = "url"
 version = "0.5.10"
@@ -1127,15 +1090,6 @@ dependencies = [
  "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "user32-sys"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "utf8-ranges"
 version = "0.1.3"
@@ -1211,6 +1165,26 @@ dependencies = [
  "vorbis-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "webpki"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "ring 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
+ "untrusted 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "webpki-roots"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "untrusted 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "webpki 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "winapi"
 version = "0.2.8"
@@ -1236,6 +1210,7 @@ dependencies = [
 "checksum aster 0.27.0 (registry+https://github.com/rust-lang/crates.io-index)" = "258989846dd255a1e0eeef92d425d345477c9999433cecc9f0879f4549d5e5c9"
 "checksum aster 0.34.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88bb8ecdf6a7eaddb7bfd872ebf5e085d343ca42ce98c582dba8046e3450b524"
 "checksum aster 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)" = "365684a2d8153bde2ca60826e54c8d3df76e06578ed868f8baaf91ae811af07b"
+"checksum base64 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2015e3793554aa5b6007e3a72959e84c1070039e74f13dde08fa64afe1ddd892"
 "checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c"
 "checksum bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5b97c2c8e8bbb4251754f559df8af22fb264853c7d009084a576cdf12565089d"
 "checksum bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "32866f4d103c4e438b1db1158aa1b1a80ee078e5d77a59a2f906fd62a577389c"
@@ -1252,11 +1227,11 @@ dependencies = [
 "checksum eventual 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b9bda6d089b434ca50f3d6feb5fca421309b8bac97b8be9af51cff879fa3f54b"
 "checksum futures 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "177a82a61dd7e528022ce97f24e54b499dd2fee4d4646a0f283c5fb500dbfe20"
 "checksum gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)" = "3689e1982a563af74960ae3a4758aa632bb8fd984cfc3cc3b60ee6109477ab6e"
-"checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518"
 "checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
 "checksum hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2da7d3a34cf6406d9d700111b8eafafe9a251de41ae71d8052748259343b58"
 "checksum httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a6e7a63e511f9edffbab707141fbb8707d1a3098615fb2adbd5769cdfcc9b17d"
 "checksum hyper 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)" = "bcb3fc65554155980167fb821d05c7c66177f92464976c0b676a19d9e03387a7"
+"checksum hyper-rustls 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aaa757ec75ba51b7dfeef94696ceb6b8b44be7775a524e1d7b64102481a7e43e"
 "checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11"
 "checksum itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae3088ea4baeceb0284ee9eea42f591226e6beaecf65373e41b38d95a1b8e7a1"
 "checksum json_macros 0.3.1 (git+https://github.com/plietar/json_macros)" = "<none>"
@@ -1267,7 +1242,6 @@ dependencies = [
 "checksum libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "a51822fc847e7a8101514d1d44e354ba2ffa7d4c194dcab48870740e327cac70"
 "checksum liblmdb-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b56d07dcf983f9b6679f768df73c72671d0087bd66329baabb63325f4f592677"
 "checksum libpulse-sys 0.0.0 (git+https://github.com/astro/libpulse-sys)" = "<none>"
-"checksum libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "cbc058951ab6a3ef35ca16462d7642c4867e6403520811f28537a4e2f2db3e71"
 "checksum linear-map 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f947d2a0ca958037e42a430bc7ea4369f97b60a2002bd927b84404509cc64cf"
 "checksum lmdb-rs 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "da5a6654b1d6ed38bed1ed96f601c719b9caacad2f5ff63afc1eb7d6c0011c2b"
 "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
@@ -1290,12 +1264,7 @@ dependencies = [
 "checksum num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "a16a42856a256b39c6d3484f097f6713e14feacd9bfb02290917904fae46c81c"
 "checksum num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "55aabf4e2d6271a2e4e4c0f2ea1f5b07cc589cc1a9e9213013b54a76678ca4f3"
 "checksum ogg-sys 0.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "a95b8c172e17df1a41bf8d666301d3b2c4efeb90d9d0415e2a4dc0668b35fdb2"
-"checksum openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)" = "c4117b6244aac42ed0150a6019b4d953d28247c5dd6ae6f46ae469b5f2318733"
-"checksum openssl-sys 0.7.17 (registry+https://github.com/rust-lang/crates.io-index)" = "89c47ee94c352eea9ddaf8e364be7f978a3bb6d66d73176572484238dd5a5c3f"
-"checksum openssl-sys-extras 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)" = "11c5e1dba7d3d03d80f045bf0d60111dc69213b67651e7c889527a3badabb9fa"
-"checksum openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ed86cce894f6b0ed4572e21eb34026f1dc8869cb9ee3869029131bc8c3feb2d"
 "checksum pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8cee804ecc7eaf201a4a207241472cc870e825206f6c031e3ee2a72fa425f2fa"
-"checksum pnacl-build-helper 1.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "61c9231d31aea845007443d62fcbb58bb6949ab9c18081ee1e09920e0cf1118b"
 "checksum portaudio 0.2.0 (git+https://github.com/mvdnes/portaudio-rs)" = "<none>"
 "checksum portaudio_sys 0.1.1 (git+https://github.com/mvdnes/portaudio-rs)" = "<none>"
 "checksum protobuf 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "6ec4c2fe04370298218a09ab53a534febf54c160c5554e4de987b6d73c916d5d"
@@ -1309,10 +1278,12 @@ dependencies = [
 "checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d"
 "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
 "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
+"checksum ring 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5b7609de2b0dbc70eb7b27a1c2508aff1af9be7c05265ce19d98631b91281ee4"
 "checksum rpassword 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab6e42be826e215f30ff830904f8f4a0933c6e2ae890e1af8b408f5bae60081e"
 "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a"
 "checksum rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "237546c689f20bb44980270c73c3b9edd0891c1be49cc1274406134a66d3957b"
 "checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
+"checksum rustls 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "340c03bcbc24e09a1fb49027a480c5dd2950edc2746e324ec684917ab84b56a0"
 "checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d"
 "checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
 "checksum serde 0.8.21 (registry+https://github.com/rust-lang/crates.io-index)" = "7b7c6bf11cf766473ea1d53eb4e3bc4e80f31f50082fc24077cf06f600279a66"
@@ -1337,7 +1308,6 @@ dependencies = [
 "checksum syntex_syntax 0.44.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5a89ee386d492cdd3855becec489c25797bb91bcbb3c2478c41969b24cb318a2"
 "checksum syntex_syntax 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6ef781e4b60f03431f1b5b59843546ce60ae029a787770cf8e0969ac1fd063a5"
 "checksum syntex_syntax 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)" = "76a302e717e348aa372ff577791c3832395650073b8d8432f8b3cb170b34afde"
-"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6"
 "checksum tempfile 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9270837a93bad1b1dac18fe67e786b3c960513af86231f6f4f57fddd594ff0c8"
 "checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a"
 "checksum termios 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d9cf598a6d7ce700a4e6a9199da127e6819a61e64b68609683cc9a01b5683a"
@@ -1353,9 +1323,9 @@ dependencies = [
 "checksum unicode-bidi 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b61814f3e7fd0e0f15370f767c7c943e08bc2e3214233ae8f88522b334ceb778"
 "checksum unicode-normalization 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5e94e9f6961090fcc75180629c4ef33e5310d6ed2c0dd173f4ca63c9043b669e"
 "checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb"
+"checksum untrusted 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "193df64312e3515fd983ded55ad5bcaa7647a035804828ed757e832ce6029ef3"
 "checksum url 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4a3440c1ed62af4a2aee71c6fb78ef32ddcb75cfa24bf42f45e07c02b6d6a2f6"
 "checksum url 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f024e241a55f5c88401595adc1d4af0c9649e91da82d0e190fe55950231ae575"
-"checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47"
 "checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f"
 "checksum uuid 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "885acc3b17fdef6230d1f7765dff1106dfd5e75a93c2f26459fbf600ed6dcc14"
 "checksum vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c3365f36c57e5df714a34be40902b27a992eeddb9996eca52d0584611cf885d"
@@ -1364,6 +1334,8 @@ dependencies = [
 "checksum vorbis-encoder 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3fb66bcdde056dd230991bb86669a1269778fe8ad1f6cee403428ac7985391bc"
 "checksum vorbis-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "729e1f15395850b4e6d19ca0cd1d42ef44707503a53b69d40ff49182b3c5589d"
 "checksum vorbisfile-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4f4306d7e1ac4699b55e20de9483750b90c250913188efd7484db6bfbe9042d1"
+"checksum webpki 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9cf747b3007eb728e9b130d09540394b7e0a57444f5981f5f2d44c86ba22ce60"
+"checksum webpki-roots 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "73093f9095120f5d3b3ea923ff09e50c3d44bffb0bb27ecf85f3ff442ecdf826"
 "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
 "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
 "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"

+ 2 - 3
Cargo.toml

@@ -28,6 +28,7 @@ env_logger      = "0.3.2"
 eventual        = "0.1.6"
 getopts         = "0.2.14"
 hyper           = { version = "0.9.1", default-features = false }
+hyper-rustls    = "0.2.1"
 lazy_static     = "0.2.0"
 linear-map      = "1.0"
 lmdb-rs         = "0.7.2"
@@ -36,6 +37,7 @@ num             = "0.1.30"
 protobuf        = "1.0.15"
 rand            = "0.3.13"
 rpassword       = "0.3.0"
+rustls          = "0.5.3"
 rust-crypto     = "0.2.34"
 rustc-serialize = "0.3.16"
 serde           = "0.8"
@@ -55,8 +57,6 @@ libpulse-sys    = { git = "https://github.com/astro/libpulse-sys", optional = tr
 json_macros     = { git = "https://github.com/plietar/json_macros" }
 protobuf_macros = { git = "https://github.com/plietar/rust-protobuf-macros" }
 
-openssl         = { version = "0.7", optional = true }
-
 mdns            = { git = "https://github.com/plietar/rust-mdns" }
 
 [build-dependencies]
@@ -70,7 +70,6 @@ with-syntex       = ["serde_codegen", "protobuf_macros/with-syntex", "json_macro
 nightly           = ["serde_macros"]
 
 with-tremor       = ["tremor"]
-facebook          = ["hyper/ssl", "openssl"]
 alsa-backend      = ["alsa"]
 portaudio-backend = ["portaudio"]
 pulseaudio-backend= ["libpulse-sys"]

+ 1 - 2
README.md

@@ -45,10 +45,9 @@ target/release/librespot --username USERNAME --cache CACHEDIR --name DEVICENAME
 For that, simply omit the `--username` argument.
 
 ## Facebook Accounts
-*librespot* can be built with Facebook authentication support. OpenSSL is required for this.
+*librespot* can use Facebook for authentication.
 
 ```shell
-cargo build --release --features facebook
 target/release/librespot --cache CACHEDIR --name DEVICENAME --facebook
 ```
 

+ 6 - 2
src/apresolve.rs

@@ -1,9 +1,11 @@
-const APRESOLVE_ENDPOINT : &'static str = "http://apresolve.spotify.com/";
+const APRESOLVE_ENDPOINT : &'static str = "https://apresolve.spotify.com/";
 const AP_FALLBACK : &'static str = "ap.spotify.com:80";
 
 use hyper;
+use hyper_rustls;
 use std::io::Read;
 use serde_json;
+use hyper::net::HttpsConnector;
 
 #[derive(Clone, Debug, Serialize, Deserialize)]
 pub struct APResolveData {
@@ -11,7 +13,9 @@ pub struct APResolveData {
 }
 
 pub fn apresolve() -> String {
-    let client = hyper::client::Client::new();
+    let connector = HttpsConnector::new(hyper_rustls::TlsClient::new());
+    let client = hyper::Client::with_connector(connector);
+
     (|| {
         let mut response = client.get(APRESOLVE_ENDPOINT).send().map_err(|_| ())?;
         let mut data = String::new();

+ 14 - 5
src/authentication/facebook.rs

@@ -1,10 +1,13 @@
 use hyper;
+use hyper::header::AccessControlAllowOrigin;
+use hyper::net::HttpsConnector;
 use hyper::net::NetworkListener;
 use hyper::server::Request;
 use hyper::server::Response;
 use hyper::uri::RequestUri;
-use hyper::header::AccessControlAllowOrigin;
+use hyper_rustls;
 use rand::{self, Rng};
+use rustls;
 use serde_json;
 use std::collections::BTreeMap;
 use std::io::Read;
@@ -13,7 +16,7 @@ use url;
 
 use protocol::authentication::AuthenticationType;
 use authentication::Credentials;
-use ::spotilocal::ssl_context;
+use spotilocal::{SPOTILOCAL_CERT, SPOTILOCAL_KEY};
 
 struct ServerHandler {
     token_tx: Mutex<mpsc::Sender<String>>,
@@ -58,7 +61,9 @@ impl hyper::server::Handler for ServerHandler {
 fn facebook_get_me_id(token: &str) -> Result<String, ()> {
     let url = format!("https://graph.facebook.com/me?fields=id&access_token={}", token);
 
-    let client = hyper::Client::new();
+    let connector = HttpsConnector::new(hyper_rustls::TlsClient::new());
+    let client = hyper::Client::with_connector(connector);
+
     let mut response = client.get(&url).send().unwrap();
     let mut body = String::new();
     response.read_to_string(&mut body).unwrap();
@@ -76,9 +81,13 @@ pub fn facebook_login() -> Result<Credentials, ()> {
         csrf: csrf.clone()
     };
 
-    let ssl = ssl_context().unwrap();
+    let mut cert_data = SPOTILOCAL_CERT;
+    let mut key_data = SPOTILOCAL_KEY;
+    let certs = rustls::internal::pemfile::certs(&mut cert_data).unwrap();
+    let key = rustls::internal::pemfile::rsa_private_keys(&mut key_data).unwrap().swap_remove(0);
+    let tls = hyper_rustls::TlsServer::new(certs, key);
 
-    let mut listener = hyper::net::HttpsListener::new("127.0.0.1:0", ssl).unwrap();
+    let mut listener = hyper::net::HttpsListener::new("127.0.0.1:0", tls).unwrap();
     let port = listener.local_addr().unwrap().port();
 
     let mut server = hyper::Server::new(listener).handle(handler).unwrap();

+ 0 - 6
src/authentication/mod.rs

@@ -171,11 +171,5 @@ fn deserialize_base64<D>(de: &mut D) -> Result<Vec<u8>, D::Error>
 mod discovery;
 pub use self::discovery::discovery_login;
 
-#[cfg(feature = "facebook")]
 mod facebook;
-#[cfg(feature = "facebook")]
 pub use self::facebook::facebook_login;
-#[cfg(not(feature = "facebook"))]
-pub fn facebook_login() -> Result<Credentials, ()> {
-    Err(())
-}

+ 5 - 10
src/lib.rs

@@ -17,6 +17,7 @@ extern crate crypto;
 extern crate eventual;
 extern crate getopts;
 extern crate hyper;
+extern crate hyper_rustls;
 extern crate linear_map;
 extern crate lmdb_rs;
 extern crate mdns;
@@ -25,31 +26,27 @@ extern crate protobuf;
 extern crate rand;
 extern crate rpassword;
 extern crate rustc_serialize;
+extern crate rustls;
 extern crate serde;
 extern crate serde_json;
 extern crate shannon;
 extern crate tempfile;
 extern crate url;
 
+extern crate librespot_protocol as protocol;
+
 #[cfg(not(feature = "with-tremor"))]
 extern crate vorbis;
 #[cfg(feature = "with-tremor")]
 extern crate tremor as vorbis;
 
-#[cfg(feature = "openssl")]
-extern crate openssl;
-
 #[cfg(feature = "alsa-backend")]
 extern crate alsa;
-
 #[cfg(feature = "portaudio")]
 extern crate portaudio;
-
 #[cfg(feature = "libpulse-sys")]
 extern crate libpulse_sys;
 
-extern crate librespot_protocol as protocol;
-
 pub mod album_cover;
 pub mod audio_backend;
 pub mod audio_decrypt;
@@ -63,12 +60,10 @@ pub mod link;
 pub mod main_helper;
 pub mod metadata;
 pub mod player;
+pub mod spotilocal;
 pub mod stream;
 pub mod util;
 pub mod version;
 
-#[cfg(feature = "facebook")]
-pub mod spotilocal;
-
 #[cfg(feature = "with-syntex")] include!(concat!(env!("OUT_DIR"), "/lib.rs"));
 #[cfg(not(feature = "with-syntex"))] include!("lib.in.rs");

+ 1 - 1
src/main.rs

@@ -19,7 +19,7 @@ fn usage(program: &str, opts: &getopts::Options) -> String {
 
 fn main() {
     if env::var("RUST_LOG").is_err() {
-        env::set_var("RUST_LOG", "info,librespot=trace")
+        env::set_var("RUST_LOG", "mdns=info,librespot=trace")
     }
     env_logger::init().unwrap();
 

+ 3 - 6
src/main_helper.rs

@@ -42,11 +42,8 @@ pub fn add_session_arguments(opts: &mut getopts::Options) {
 
 pub fn add_authentication_arguments(opts: &mut getopts::Options) {
     opts.optopt("u", "username", "Username to sign in with", "USERNAME")
-        .optopt("p", "password", "Password", "PASSWORD");
-
-    if cfg!(feature = "facebook") {
-        opts.optflag("", "facebook", "Login with a Facebook account");
-    }
+        .optopt("p", "password", "Password", "PASSWORD")
+        .optflag("", "facebook", "Login with a Facebook account");
 }
 
 pub fn add_player_arguments(opts: &mut getopts::Options) {
@@ -116,7 +113,7 @@ pub fn get_credentials(session: &Session, matches: &getopts::Matches) -> Credent
             Credentials::with_password(username.clone(), password)
         }
 
-        (None, _, _) if cfg!(feature = "facebook") && matches.opt_present("facebook")
+        (None, _, _) if matches.opt_present("facebook")
             => facebook_login().unwrap(),
 
         (None, _, Some(credentials))

+ 2 - 22
src/spotilocal.rs

@@ -1,22 +1,2 @@
-use hyper::net::Openssl;
-use openssl::crypto::pkey::PKey;
-use openssl::ssl::{SslContext, SslMethod, SSL_VERIFY_NONE};
-use openssl::ssl::error::SslError;
-use openssl::x509::X509;
-use std::io::Cursor;
-use std::sync::Arc;
-
-static SPOTILOCAL_CERT : &'static [u8] = include_bytes!("data/spotilocal.cert");
-static SPOTILOCAL_KEY : &'static [u8] = include_bytes!("data/spotilocal.key");
-
-pub fn ssl_context() -> Result<Openssl, SslError> {
-    let cert = try!(X509::from_pem(&mut Cursor::new(SPOTILOCAL_CERT)));
-    let key = try!(PKey::private_key_from_pem(&mut Cursor::new(SPOTILOCAL_KEY)));
-
-    let mut ctx = try!(SslContext::new(SslMethod::Sslv23));
-    try!(ctx.set_cipher_list("DEFAULT"));
-    try!(ctx.set_private_key(&key));
-    try!(ctx.set_certificate(&cert));
-    ctx.set_verify(SSL_VERIFY_NONE, None);
-    Ok(Openssl { context: Arc::new(ctx) })
-}
+pub static SPOTILOCAL_CERT : &'static [u8] = include_bytes!("data/spotilocal.cert");
+pub static SPOTILOCAL_KEY : &'static [u8] = include_bytes!("data/spotilocal.key");