Open Zhappa opened 4 years ago
Hi, @robjtede! https://github.com/actix/actix-web/issues/1045#issuecomment-637807016 - confirm this happens not only within my machine.
Can you please take a look? Thank you!
Also, if this issue is caused by the missing of openssl binaries in windows (which, i believe, should be downloaded separately, from http://gnuwin32.sourceforge.net/packages/openssl.htm for instance), then this example is not really a cross-platform one. Maybe additional example using https://github.com/ctz/rustls and https://github.com/ctz/rustls-native-certs will help. Thanks!
Related to: https://github.com/actix/actix-web/issues/1560
I’m not able to test on Windows. Sorry.
Hi, I had the same error on MacOS Catalina using certificates installed with mkcert:
stable-x86_64-apple-darwin (default)
rustc 1.47.0 (18bf6b4f0 2020-10-07)
actix-web = { version = "~3.1", features = ["openssl"] }
actix-cors = "~0.4"
openssl = { version = "~0.10" }
curl and firefox can connect successfully to the SSL enabled Actix server.
However, openssl fails with a similar error when doing the following:
openssl s_client -connect 127.0.0.1:8888
Errors:
verify error:num=20:unable to get local issuer certificate
Verify return code: 21 (unable to verify the first certificate)
I fixed openssl by using this command:
openssl s_client -connect 127.0.0.1:8888 -CAfile ~/Library/Application\ Support/mkcert/rootCA.pem
Response:
Verify return code: 0 (ok)
So it looks like even though some other programs work, openssl itself doesn't see the file automatically.
I had to fix the code like this:
let mut builder = SslConnector::builder(SslMethod::tls()).unwrap();
builder
.set_ca_file("rootCA.pem")
.unwrap();
This is strange, but example never work on my machine, i always get something like:
The only way to make it work is to disable verification completely (which is not a case to work with)
Can anybody verify this example works out of the box on his machine? (https://github.com/actix/examples/blob/22c8eaae87775d3da53ea3a73067c1a228a3a3a4/awc_https/src/main.rs#L8-L12)
Also my "rustup show":
I using windows 10 x64
Originally posted by @Zhappa in https://github.com/actix/actix-web/issues/1045#issuecomment-637788229