Rust upload file error Failed to connect to host: the handshake failed: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1916:: unable to get local issuer certificate
Rust upload file error Failed to connect to host: the handshake failed: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1916:: unable to get local issuer certificate
I got the same error using reqwest in a rust application running in an empty docker image FROM scratch instead of running for example alpine.
Per default reqwest will use the system TLS implementation to initiate a TLS connection, but as I was using the empty FROM scratch image, there (obviously) was no system implementation there.
My solution was to use the rustls-tls cargo feature to compile and use the tls implementation written in rust which is cooler anyway.
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"] }