Rust + OpenSSL
Hi, i am traying to deploy an rust api to railway. But i always get a openssl error
30 Replies
Project ID:
3e64c14a-faca-43cd-954b-1d0d7e1ce767
3e64c14a-faca-43cd-954b-1d0d7e1ce767
are you trying to start an https server?
No
But i have a depency "reqwest" that uses openssl-sys
show me the full error logs please
try adding this as a nixpacks.toml file to your project
Same errror
try this instead
oops
if this doesn't work, try disabling default imports for that reqwests package and only import the things you use from it, and then hopefully you aren't using something with openssl
The problem is that i need the tls-native feature
I'm out of ideas, sorry
what i should do then?
Google?
I tried everything, but nothing 😢
try moving to a Dockerfile based deployment
It's working fine now!
Thank you!
you are using a dockerfile now?
For anyone looking here, I had this same issue and with these dependencies, was able to get it right. Main thing that worked for me was the openssl dependency.
[dependencies]
axum = "0.5.11"
tokio = { version = "1.0", features = ["full"] }
tracing = "0.1.35"
tracing-subscriber = "0.3.14"
serde = { version = "1.0.138", features = ["derive"] }
serde_json = "1.0"
postgrest = "1.0"
env_logger = "0.9.0"
tower = "0.4.13"
tower-http = { version = "0.3.4", features = ["full", "cors"] }
dotenv = "0.15.0"
http = "0.2.8"
reqwest = { version = "0.11", features = ["json", "rustls-tls"] }
chrono = { version = "0.4.26", features = ["serde"] }
jsonwebtoken = "8.3.0"
anyhow = "1.0.71"
uuid = { version = "1.4.0", features = ["serde"] }
aws-config = "0.55.3"
aws-sdk-secretsmanager = "0.28.0"
sqlx = { version = "0.7", features = [ "runtime-tokio", "tls-rustls", "postgres", "mysql", "macros", "uuid", "chrono", "bigdecimal"] }
reqwest-retry = "0.2.2"
reqwest-middleware = "0.2.2"
serde_yaml = "0.9.23"
neo4rs = "0.6.2"
maplit = "1.0.2"
futures = "0.3.28"
regex = "1.9.1"
bigdecimal = "0.4.1"
openssl = { version = "0.10", features = ["vendored"] }
interesting I tried this as well but no dice
Ill let you know if I discover an alternative sollution