From 0d46a64806ca273261d40f2685110953d34c2a7e Mon Sep 17 00:00:00 2001 From: Darius Auding <Darius.auding@gmx.de> Date: Wed, 19 Jul 2023 14:42:48 +0200 Subject: [PATCH] Implement HTTPS --- core/http/Cargo.lock | 269 ++++++++++++++++++- core/http/Cargo.toml | 1 + core/http/src/certificates/certificate.crt | 29 +++ core/http/src/certificates/identity.pfx | Bin 0 -> 4179 bytes core/http/src/certificates/private.key | 54 ++++ core/http/src/handlers/handler.rs | 25 +- core/http/src/handling/response/response.rs | 3 +- core/http/src/setup.rs | 10 +- site/Cargo.lock | 275 +++++++++++++++++++- 9 files changed, 655 insertions(+), 11 deletions(-) create mode 100644 core/http/src/certificates/certificate.crt create mode 100644 core/http/src/certificates/identity.pfx create mode 100644 core/http/src/certificates/private.key diff --git a/core/http/Cargo.lock b/core/http/Cargo.lock index 8496ac6..9ac579c 100644 --- a/core/http/Cargo.lock +++ b/core/http/Cargo.lock @@ -20,12 +20,79 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "hermit-abi" version = "0.2.6" @@ -35,20 +102,59 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + [[package]] name = "http" version = "0.1.0" dependencies = [ "phf", "tokio", + "tokio-native-tls", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.2", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + [[package]] name = "libc" version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "lock_api" version = "0.4.9" @@ -80,16 +186,84 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "num_cpus" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "openssl" +version = "0.10.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -108,7 +282,7 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "windows-sys 0.45.0", ] @@ -161,6 +335,12 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + [[package]] name = "proc-macro2" version = "1.0.56" @@ -203,12 +383,67 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rustix" +version = "0.37.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -262,6 +497,20 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "tokio" version = "1.28.2" @@ -292,12 +541,28 @@ dependencies = [ "syn 2.0.15", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "unicode-ident" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/core/http/Cargo.toml b/core/http/Cargo.toml index 45da492..d2fc133 100644 --- a/core/http/Cargo.toml +++ b/core/http/Cargo.toml @@ -8,3 +8,4 @@ edition = "2021" [dependencies] tokio = { version = "1.28.2", features = ["full"] } phf = { version = "0.11", features = ["macros"] } +tokio-native-tls = "0.3.0" diff --git a/core/http/src/certificates/certificate.crt b/core/http/src/certificates/certificate.crt new file mode 100644 index 0000000..fa80d20 --- /dev/null +++ b/core/http/src/certificates/certificate.crt @@ -0,0 +1,29 @@ +-----BEGIN CERTIFICATE----- +MIIE+zCCAuOgAwIBAgIUduzhfNiMYBDh6wuv3MjdxK2C6bYwDQYJKoZIhvcNAQEL +BQAwDTELMAkGA1UEBhMCREUwHhcNMjMwNzE5MTEyNzE3WhcNMjQwNzE4MTEyNzE3 +WjANMQswCQYDVQQGEwJERTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB +AKKTQ3sMq9yYNST56n9NbNkycJ1QQORl6DtqqFB3iVRrNOzs0o1RAqXtVCWIiyJ2 +cvC/nPz9V+QRM9ZwovYGt7I2IGm3Wu15wWJH71QakPTElsoM+twVHUU+E8yNaDpY +vibP+6MIz7O1DD/uSqA5779n0/eZuC6Li1LYiaJNLHst9sqo1f5UccG66HdanT6+ +oCbvUyS8tiVnepM0rTku7k/7XVkKVa71VAojoVfNhSpF/tWQJC5PD8Sp9X5E31QK +BMjMckdS/ev4qruPGBOF10eilt+nJAxUpbJ87UamG/VxI3DDNchZ+ssckgDRcd44 +Td3Z2SsOAcHebCtrgOL4hFZQ+DsBMIDCWuj/BcKmN+RsnE40X7I01qBjbUABU/kp +cfJxd3YtkBysQ8VuMz00/jLzpUcTvbVjXq9ktCGBFbAUd+qqxNNA0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1Dng6g== +-----END CERTIFICATE----- diff --git a/core/http/src/certificates/identity.pfx b/core/http/src/certificates/identity.pfx new file mode 100644 index 0000000000000000000000000000000000000000..23327800204e7b757f67586e636994a03c8fc84e GIT binary patch literal 4179 zcmai1Ra6v=)@6pFdk8^9x@$;jm9CNQF6j^jDHVq97#JFc5|Ebek`@qQXr$W#q?_wq z|G&QP@jje&*4g`EzwNyb1V*X>1Ykm7q*&N^Tw%eoLY01`%W4uX*!LtrEa5E$0l zzZ5nShBf&Y8V3R}{;t7)834rKp96~sq6*>s_auZo0pYS6RcrtQYT-a2E(U}U8~6Xz zfOuFK5ISr;%P?ht9VQ6C1tMi?%j@!b&u#f8D)F&@q)=QS49oIfT+DoUQR5<~q#n*! z>Q>jAsB;KjDLh)b%E$%T#PR1F{%{30&d{gdC|*A3kC(>#8r;mf8vhY1yCXY`m5k_E zLef`J?b_Wp74i0k<*99c=)mbQM!&#|v)kug6Nm;f;3yf9Xo|CK|A9|s@c6v{A(1j& zv?JE6In!lcuSAn*tUk13Ep{}RC8?hr`{pWAB9hLR)Jk%WF`{rFmQg-u#~aX4tUnR1 znb9S`N1Pb9zq@>C-_C8Ie}>HF#28%-<wP@{o(;CFSj)C+)!EiDvlMt&C1^)@0<Squ zZi4(TzNEl03VasI+rEDMedfOTRyXMi!c8Dj)lfGi%4KC4=Mo}Ny8>19WCN!+0u12> zAw_4<*J${1V)54xD0UAb33FaiYY6`frO%u5*3>yP)a2&AI@$`jecbXpSbHInR<<vx zm>5=+Z&Mo(;qhQmNqOfDRDUo}tDTu>5Zpv)k|vsW0Tyg2)coB5IY6|RIbjrN+5Ibf z`^CBLqC+>xay--^Uy9On{{B{Igik}m9fy@DlH+952U131rV?86sixKK4c7FvazR7N zO<m$UwEr-)ET?#0NH0I*E--2OwR1Fwlq|j)sy0Ve7R<5Jj;AU!<g!wIRv!E#Xq2b? zQqt$*4AG8=%cZEghbj&g&ywJI@B0+xGiePGv1@RA^z-OlLqlt@;7eC~3@dGOToBj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CeyCWgJvkNfnpz}yXcm$4dU)nypJj|(gL4&>Y*<}K+dFr4>){Fh zynoL~x-0CpJGEt@r2$WKS+0M@C%_6}{-@yKQ3_CjD4Ig7EYD$@n+IIwJFdD#UkXwU zM<FjE0uZ8q-f<uR3j@TE!lNj`dVR=xddkL3Xi#M+jPh`BHOQDN_+;mCvc6*u!VO-D N;o^^QT>5X-`wu`L;u-(| literal 0 HcmV?d00001 diff --git a/core/http/src/certificates/private.key b/core/http/src/certificates/private.key new file mode 100644 index 0000000..2bcad34 --- /dev/null +++ b/core/http/src/certificates/private.key @@ -0,0 +1,54 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIJnDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIMWz28Wi/jXECAggA +MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECE+qsELeDfrPBIIJSHsoycMsEN+R +sTC7Si5KPfZWkYCaQTAmTPYnV6StHLmj8XNzCIUBxZAvhuWYUnCKHjT9lkJM8jEj +t22Ga3zSj/wdrGCPsJJuqc32grHMUXkZafAFXAQ8z3oVi3D4Kzed/ReUJJsDNnmP +dVi6vD1tDT/9mKI6Ootj370xDjXxPL6AEMvkjC7C/u0fwqSNUGiDn1X3h1G5z1+e +KCgRmmZnSydWbdpb6zBI6WKfvwqJafOpD2WJLuM/cmVPJir4zX2rruisyA2GHsMM +oAKIxii+mGETIr+Z+fyT2j7pZUKONdu6o34h2yRr//LIWV0fhQGPgtkVvx/ka6TH +8iZjKoCg5C0bNpPxILkflFcueAru9eo0IBUPku5mmaowxoTnv7JSSrdaFy98W/e/ +fHrtHh6Xg3sW/0Ny5AQpQX62WlyumbSLllKLMDtSUXryFBUh1Ftv5zQ5ixQURyP7 +TMhDh7Jg3SSgz8BDg7LTh+KcW+F3UGtnqSFZxu99ExbHMfQZL5OJgINaJzHrOM29 +YASzjHMf/nXHXA24nSCOHVhE3cXaLW3UZFhk4KUyFworF5uv+bP1bB10Fgvbl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8k +CUZXu4SbsmRxmaXUf1MbGXqS7ShBrDBci/cIxOWOoUl+UiOIht8yGNYwyeArOCWJ +vb+LNyNK7CxHaeyYVdZy58szWzH1H3Np/fa0qEHQrTseHAbwjC+beI5hlXxx/AgR +cl8Y/Em8LdmODC5RL9JuMUghxzmgTR8Y9YakkwoRV46Hjp41Ayi2zBz6qKbwlR3p +o39WoAT2GguxIQvCCYK7G7x3AS8vo4Q6zi9C20oWAxTN1ovn1gOknR54Y0ZqZ5EG +DO5admR943ieM6p4byLqkfCy8A/k4k4RWcjVovMs4dAkl+U/KCKAZDnuvosCL4tm +bhop6nLzxBmxaevSbWjWZ/bCBMLitfaic4y5TiyWscoZP0uxfS25wy19ATPaBi9j +EerRGtfjcCkvghGFylCLZb8MQrVTAEugjNtrViqC4c7UUC+/j9IijmuUEE4IIVsN ++C+hItN7Lj2S0FM6dEa+1g== +-----END ENCRYPTED PRIVATE KEY----- diff --git a/core/http/src/handlers/handler.rs b/core/http/src/handlers/handler.rs index 7ffa9e9..f1847b2 100644 --- a/core/http/src/handlers/handler.rs +++ b/core/http/src/handlers/handler.rs @@ -1,9 +1,10 @@ use std::{io, path::PathBuf}; use tokio::{ - io::{AsyncBufReadExt, AsyncReadExt, BufReader}, - net::TcpStream, + io::{AsyncBufReadExt, AsyncReadExt, BufReader, AsyncWriteExt}, + net::TcpStream, stream, }; +use tokio_native_tls::{TlsStream, TlsAcceptor}; use crate::{handling::{ file_handlers::NamedFile, @@ -28,7 +29,11 @@ static MAX_HTTP_MESSAGE_SIZE: u16 = 4196; /// /// # Panics /// No Panics -pub async fn handle_connection(mut stream: TcpStream, mountpoints: Vec<MountPoint<'_>>) { +pub async fn handle_connection(stream: TcpStream, mountpoints: Vec<MountPoint<'_>>, acceptor: TlsAcceptor) { + let Ok(mut stream) = acceptor.accept(stream).await else { + eprintln!("\x1b[31mClient used http, not https\x1b[0m"); + return; + }; let mut buf_reader = BufReader::new(&mut stream); let mut http_request: Vec<String> = Vec::with_capacity(10); loop { @@ -192,7 +197,7 @@ fn failure_handler(status: Status) -> Response { } /// Handler for len_not_defined errors. writes back directly -async fn len_not_defined(stream: TcpStream, status: Status) -> io::Result<()> { +async fn len_not_defined(stream: TlsStream<TcpStream>, status: Status) -> io::Result<()> { let page_411 = NamedFile::open(PathBuf::from("411.html")).unwrap(); Response { cookies: None, @@ -209,3 +214,15 @@ async fn len_not_defined(stream: TcpStream, status: Status) -> io::Result<()> { fn error_occured_when_writing(e: io::Error) { eprintln!("\x1b[31mError {e} occured when trying to write answer to TCP-Stream for Client, aborting\x1b[0m"); } + +async fn redirect_to_secure(mut stream: TcpStream) { + let resp = Response { + cookies: None, + status: Some(Status::MovedPermanently), + headers: vec!["Location: https://127.0.0.1".to_string()], + body: Box::new("") + }.build(None); + if let Err(e) = stream.write_all(&resp).await { + error_occured_when_writing(e); + } +} diff --git a/core/http/src/handling/response/response.rs b/core/http/src/handling/response/response.rs index 62de6e9..67f87bb 100644 --- a/core/http/src/handling/response/response.rs +++ b/core/http/src/handling/response/response.rs @@ -1,6 +1,7 @@ use std::io::Result; use tokio::{io::AsyncWriteExt, net::TcpStream}; +use tokio_native_tls::TlsStream; use crate::handling::{methods::Method, request::Request, response::Status}; @@ -32,7 +33,7 @@ impl Response { compiled_out } /// Builds and writes The http-Response, consumes the [tokio::net::TcpStream] [Request] and [Response] - pub async fn write(self, mut stream: TcpStream, request: Option<Request>) -> Result<()> { + pub async fn write(self, mut stream: TlsStream<TcpStream>, request: Option<Request>) -> Result<()> { let resp = self.build(request); stream.write_all(&resp).await?; Ok(()) diff --git a/core/http/src/setup.rs b/core/http/src/setup.rs index 31669bb..c1b3ced 100644 --- a/core/http/src/setup.rs +++ b/core/http/src/setup.rs @@ -1,10 +1,11 @@ -use std::thread::available_parallelism; +use std::{thread::available_parallelism}; use tokio::{ net::TcpListener, select, signal::unix::{signal, SignalKind}, }; +use tokio_native_tls::{native_tls::{Identity, self}, TlsAcceptor}; use crate::{ handlers::handler::handle_connection, @@ -28,6 +29,7 @@ pub struct Config { mountpoints: Option<Vec<MountPoint<'static>>>, /// Contains a [tokio::net::TcpListener] that is bound for the server address: TcpListener, + tls_acceptor: TlsAcceptor, } impl<'a> Config { @@ -103,7 +105,8 @@ impl<'a> Config { } Ok((socket, _)) = self.address.accept() => { let mountpoints = self.mountpoints.clone().unwrap(); - tokio::spawn(async move { handle_connection(socket, mountpoints).await; }); + let tls_acceptor = self.tls_acceptor.clone(); + tokio::spawn(async move { handle_connection(socket, mountpoints, tls_acceptor).await; }); } } } @@ -135,6 +138,8 @@ pub async fn build(ip: &str) -> Config { if ip.len() != 2 { panic!("Invalid IP Address"); } + let identity = Identity::from_pkcs12(include_bytes!("certificates/identity.pfx"), "1234").unwrap(); + let port = ip[1]; let ip = ip[0]; let workers = available_parallelism().unwrap().get(); @@ -148,5 +153,6 @@ pub async fn build(ip: &str) -> Config { Config { mountpoints: None, address: listener, + tls_acceptor: native_tls::TlsAcceptor::builder(identity).build().unwrap().into() } } diff --git a/site/Cargo.lock b/site/Cargo.lock index 84f675c..8373d43 100644 --- a/site/Cargo.lock +++ b/site/Cargo.lock @@ -20,12 +20,79 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "hermit-abi" version = "0.2.6" @@ -35,20 +102,59 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + [[package]] name = "http" version = "0.1.0" dependencies = [ "phf", "tokio", + "tokio-native-tls", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.2", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + [[package]] name = "libc" version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "lock_api" version = "0.4.9" @@ -59,6 +165,12 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + [[package]] name = "mio" version = "0.8.7" @@ -70,16 +182,84 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "num_cpus" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "openssl" +version = "0.10.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -98,7 +278,7 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "windows-sys 0.45.0", ] @@ -151,6 +331,12 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + [[package]] name = "proc-macro2" version = "1.0.59" @@ -193,12 +379,67 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rustix" +version = "0.37.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -260,6 +501,20 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "tokio" version = "1.28.2" @@ -290,12 +545,28 @@ dependencies = [ "syn 2.0.18", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "unicode-ident" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" -- GitLab