1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-08-24 19:49:22 +02:00

Исключение vendored OpenSSL

This commit is contained in:
Anton Titovets
2025-03-27 17:27:28 +03:00
parent b77a6832a5
commit 9285336b92
22 changed files with 247 additions and 42 deletions

View File

@@ -143,6 +143,16 @@ dependencies = [
"cc",
]
[[package]]
name = "core-foundation"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
@@ -274,6 +284,22 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "errno"
version = "0.3.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
dependencies = [
"libc",
"windows-sys 0.59.0",
]
[[package]]
name = "fastrand"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]]
name = "flate2"
version = "1.1.0"
@@ -291,6 +317,21 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[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 = "form_urlencoded"
version = "1.2.1"
@@ -318,7 +359,19 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
dependencies = [
"cfg-if",
"libc",
"wasi",
"wasi 0.11.0+wasi-snapshot-preview1",
]
[[package]]
name = "getrandom"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0"
dependencies = [
"cfg-if",
"libc",
"r-efi",
"wasi 0.14.2+wasi-0.2.4",
]
[[package]]
@@ -568,6 +621,12 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "linux-raw-sys"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413"
[[package]]
name = "litemap"
version = "0.7.5"
@@ -616,6 +675,7 @@ dependencies = [
"lru",
"mysql_common",
"named_pipe",
"native-tls",
"pem",
"percent-encoding",
"socket2",
@@ -684,6 +744,23 @@ dependencies = [
"winapi",
]
[[package]]
name = "native-tls"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e"
dependencies = [
"libc",
"log",
"openssl",
"openssl-probe",
"openssl-sys",
"schannel",
"security-framework",
"security-framework-sys",
"tempfile",
]
[[package]]
name = "num-bigint"
version = "0.4.6"
@@ -724,6 +801,50 @@ version = "1.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc"
[[package]]
name = "openssl"
version = "0.10.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd"
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",
]
[[package]]
name = "openssl-probe"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
[[package]]
name = "openssl-sys"
version = "0.9.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "opi_mysql"
version = "0.1.0"
@@ -732,6 +853,7 @@ dependencies = [
"base64",
"chrono",
"mysql",
"native-tls",
"serde_json",
]
@@ -821,6 +943,12 @@ dependencies = [
"proc-macro2",
]
[[package]]
name = "r-efi"
version = "5.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
[[package]]
name = "rand"
version = "0.8.5"
@@ -848,7 +976,7 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
"getrandom",
"getrandom 0.2.15",
]
[[package]]
@@ -880,6 +1008,19 @@ version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "rustix"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96"
dependencies = [
"bitflags",
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.59.0",
]
[[package]]
name = "rustversion"
version = "1.0.20"
@@ -898,6 +1039,38 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ece8e78b2f38ec51c51f5d475df0a7187ba5111b2a28bdc761ee05b075d40a71"
[[package]]
name = "schannel"
version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d"
dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "security-framework"
version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
dependencies = [
"bitflags",
"core-foundation",
"core-foundation-sys",
"libc",
"security-framework-sys",
]
[[package]]
name = "security-framework-sys"
version = "2.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "serde"
version = "1.0.217"
@@ -1018,6 +1191,19 @@ dependencies = [
"syn",
]
[[package]]
name = "tempfile"
version = "3.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf"
dependencies = [
"fastrand",
"getrandom 0.3.2",
"once_cell",
"rustix",
"windows-sys 0.59.0",
]
[[package]]
name = "termcolor"
version = "1.4.1"
@@ -1174,6 +1360,15 @@ version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasi"
version = "0.14.2+wasi-0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3"
dependencies = [
"wit-bindgen-rt",
]
[[package]]
name = "wasm-bindgen"
version = "0.2.100"
@@ -1369,6 +1564,15 @@ dependencies = [
"memchr",
]
[[package]]
name = "wit-bindgen-rt"
version = "0.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
dependencies = [
"bitflags",
]
[[package]]
name = "write16"
version = "1.0.0"

View File

@@ -15,7 +15,8 @@ opt-level = "z"
[dependencies]
addin1c = "0.5.0"
mysql = { version = "26.0.0", features = ["time", "chrono"] }
mysql = { version = "26.0.0", features = ["time", "chrono", "native-tls"] }
native-tls = { version = "0.2.14" }
serde_json = "1.0"
base64 = "0.22.1"
chrono = "0.4.40"

View File

@@ -0,0 +1,23 @@
[target.x86_64-unknown-linux-gnu]
pre-build = [
"export DEBIAN_FRONTEND=noninteractive",
"apt-get update",
"apt-get install -y build-essential",
"apt-get install -y pkg-config libssl3 libssl-dev", # Устанавливаем OpenSSL
]
image = "ubuntu:22.04"
[target.i686-unknown-linux-gnu.env]
[target.i686-unknown-linux-gnu]
pre-build = [
"export DEBIAN_FRONTEND=noninteractive",
"dpkg --add-architecture i386", # Добавляем поддержку 32-битных библиотек
"apt-get update",
"apt-get install -y build-essential",
"apt-get install -y pkg-config libssl3:i386 libssl-dev:i386 ca-certificates:i386", # Устанавливаем 32-битные OpenSSL и корневые сертификаты
"update-ca-certificates", # Обновляем корневые сертификаты
"apt-get install -y gcc-multilib g++-multilib",
"apt-get install -y gcc-i686-linux-gnu g++-i686-linux-gnu",
]
image = "ubuntu:22.04"

View File

@@ -3,10 +3,6 @@
:: Установить переменную
set CARGO_NAME=opi_mysql
set LIB_NAME=OPI_MySQL
set OPENSSL_DIR=C:\msys64\mingw64
set OPENSSL_LIB_DIR=%OPENSSL_DIR%\lib
set OPENSSL_INCLUDE_DIR=%OPENSSL_DIR%\include
:: Перейти в директорию проекта
cd /d "%~dp0"
@@ -20,7 +16,7 @@ cargo build --release --target x86_64-pc-windows-msvc
if errorlevel 1 goto :error
:: Сборка для x86_64-unknown-linux-gnu
cargo zigbuild --release --target x86_64-unknown-linux-gnu
cross build --release --target x86_64-unknown-linux-gnu
if errorlevel 1 goto :error
:: Сборка для i686-pc-windows-msvc
@@ -28,7 +24,7 @@ cargo build --release --target i686-pc-windows-msvc
if errorlevel 1 goto :error
:: Сборка для i686-unknown-linux-gnu
cargo zigbuild --release --target i686-unknown-linux-gnu
cross build --release --target i686-unknown-linux-gnu
if errorlevel 1 goto :error
:: Копирование файлов .dll и .so

View File

@@ -28,7 +28,7 @@ pub fn execute_query(
Some(array) => process_mysql_params(array),
None => return format_json_error("Parameters must be a JSON array")
};
let mut conn = match pool.get_conn(){
Ok(conn) => conn,
Err(e) => return format_json_error(e)

View File

@@ -503,15 +503,6 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
[[package]]
name = "openssl-src"
version = "300.4.2+3.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
version = "0.9.106"
@@ -520,7 +511,6 @@ checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd"
dependencies = [
"cc",
"libc",
"openssl-src",
"pkg-config",
"vcpkg",
]

View File

@@ -20,6 +20,6 @@ serde_json = "1.0"
base64 = "0.22.1"
chrono = "0.4.39"
uuid = "1.12.1"
native-tls = { version = "0.2.14", features = ["vendored"] }
native-tls = { version = "0.2.14" }
postgres-native-tls = "0.5"

View File

@@ -3,9 +3,9 @@ pre-build = [
"export DEBIAN_FRONTEND=noninteractive",
"apt-get update",
"apt-get install -y build-essential",
"apt-get install -y pkg-config libssl1.1 libssl-dev", # Устанавливаем OpenSSL
"apt-get install -y pkg-config libssl3 libssl-dev", # Устанавливаем OpenSSL
]
image = "ubuntu:20.04"
image = "ubuntu:22.04"
[target.i686-unknown-linux-gnu.env]
@@ -15,9 +15,9 @@ pre-build = [
"dpkg --add-architecture i386", # Добавляем поддержку 32-битных библиотек
"apt-get update",
"apt-get install -y build-essential",
"apt-get install -y pkg-config libssl1.1:i386 libssl-dev:i386 ca-certificates:i386", # Устанавливаем 32-битные OpenSSL и корневые сертификаты
"apt-get install -y pkg-config libssl3:i386 libssl-dev:i386 ca-certificates:i386", # Устанавливаем 32-битные OpenSSL и корневые сертификаты
"update-ca-certificates", # Обновляем корневые сертификаты
"apt-get install -y gcc-multilib g++-multilib",
"apt-get install -y gcc-i686-linux-gnu g++-i686-linux-gnu",
]
image = "ubuntu:20.04"
image = "ubuntu:22.04"

View File

@@ -177,15 +177,6 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
[[package]]
name = "openssl-src"
version = "300.4.2+3.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
version = "0.9.106"
@@ -194,7 +185,6 @@ checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd"
dependencies = [
"cc",
"libc",
"openssl-src",
"pkg-config",
"vcpkg",
]

View File

@@ -14,5 +14,5 @@ strip = true # Automatically strip symbols from the binary.
[dependencies]
addin1c = "0.5.0"
native-tls = { version = "0.2.14", features = ["vendored"] }
native-tls = { version = "0.2.14" }
serde_json = "1.0.140"

View File

@@ -3,10 +3,11 @@ pre-build = [
"export DEBIAN_FRONTEND=noninteractive",
"apt-get update",
"apt-get install -y build-essential",
"apt-get install -y pkg-config libssl1.1 libssl-dev", # Устанавливаем OpenSSL
"apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*"
"apt-get install -y pkg-config libssl3 libssl-dev", # Устанавливаем OpenSSL
]
image = "ubuntu:20.04"
image = "ubuntu:22.04"
[target.i686-unknown-linux-gnu.env]
[target.i686-unknown-linux-gnu]
pre-build = [
@@ -14,10 +15,9 @@ pre-build = [
"dpkg --add-architecture i386", # Добавляем поддержку 32-битных библиотек
"apt-get update",
"apt-get install -y build-essential",
"apt-get install -y pkg-config libssl1.1 libssl-dev libssl1.1:i386 libssl-dev:i386 ca-certificates:i386", # Устанавливаем 32-битные OpenSSL и корневые сертификаты
"apt-get install -y pkg-config libssl3:i386 libssl-dev:i386 ca-certificates:i386", # Устанавливаем 32-битные OpenSSL и корневые сертификаты
"update-ca-certificates", # Обновляем корневые сертификаты
"apt-get install -y gcc-multilib g++-multilib",
"apt-get install -y gcc-i686-linux-gnu g++-i686-linux-gnu",
"apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*"
]
image = "ubuntu:20.04"
image = "ubuntu:22.04"

View File

@@ -148,6 +148,7 @@ impl AddIn {
match TcpStream::connect(&self.address) {
Ok(tcp_stream) => {
if self.use_tls {
let mut builder = native_tls::TlsConnector::builder();
if !self.ca_cert_path.is_empty() {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.