Closed jfaust closed 1 year ago
Of course, as soon as I posted this I had a thought, and it turned out to be correct. The problem is that rust-native-tls
is using the same container name for the store no matter what. Not sure what the right solution here is, but I don't think it's a problem in schannel-rs
.
I have a project where I'm generating a self-signed certs with
rcgen
and then using that cert withrust-native-tls
&hyper
. I've run into some strange problems when testing that I've isolated into a repro. I believe this is anschannel
issue, because I can only reproduce it on Windows, and the handshake error is coming from this crate.To reproduce (the order of operations here is very important):
cargo run --example server 12345
curl -v --insecure https://localhost:12345/
- it should succeed. This is just to confirm that everything seems to be working. Running that command over and over works just fine.cargo run --example server 12346
curl -v --insecure https://localhost:12345/
). I get this error:Sometimes it's
last octet invalid
, sometimesfirst octet invalid
, sometimesdata too large for modulus
.curl
command will work again. However, if you now run it against the second server (port12346
), that one no longer works (you can test it before step (5) to confirm it worked initially).It seems like there is some kind of cross-process corruption happening somehow, and I am baffled as to how that would be the case. As far as I can tell, the two processes are completely disconnected from each other - they're bound to different ports, they use different self-signed certs (generated at process startup), and they're not communicating with each other in any way.
Any thoughts on what could be happening here?