I want to create simple HTTPS server in Actix-Web using this tutorial When using self-singned TLS keys created by openssl like in tutorial, everything works fine at localhost. But when I try to load real keys from, i.e ZeroSSL, browser can't open my service with ERR_SSL_VERSION_OR_CIPHER_MISMATCH for Chrome-based and SSL_ERROR_NO_CYPHER_OVERLAP for Mozilla.
async fn main() -> std::io::Result<()> {
let cert_key_file: PathBuf = PathBuf::from("zerossl/private.key");
let cert_file: PathBuf = PathBuf::from("zerossl/certificate.crt");
let cert_ca_file: PathBuf = PathBuf::from("zerossl/ca_bundle.crt");
// To be shorter I omitted creation of paths: path_to_certificate, path_to_ca, path_to_key
let mut local_address = format!("0.0.0.0:{}", SERVICE_PORT);
let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
builder
.set_private_key_file(path_to_key, SslFiletype::PEM)
.unwrap();
builder.set_certificate_chain_file(path_to_ca).unwrap();
builder.set_certificate_file(path_to_certificate, SslFiletype::PEM).unwrap();
HttpServer::new(|| {
App::new()
//.route("/{filename:.*}", web::get().to(index))
.route("/hello", web::get().to(|| async { "Hello World!" }))
.service(greet)
})
.bind_openssl(local_address, builder)?
.run()
.await
}
What did I do wrong?
Upd. Added curl info
ā release git:(master) curl -v https://zavijavasoft.com:8080
* Trying 37.140.197.152:8080...
* TCP_NODELAY set
* Connected to zavijavasoft.com (37.140.197.152) port 8080 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS alert, handshake failure (552):
* error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
* Closing connection 0
curl: (35) error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure