Fix EncryptionResponse message in pq_proto.rs

Positive EncryptionResponse should set 'S' byte, not 'Y'. With that
fix it is possible to connect to proxy with SSL enabled and read
deciphered notice text. But after the first query everything stucks.
This commit is contained in:
Stas Kelvich
2021-09-27 10:36:22 +03:00
parent f84eaf4f05
commit 3bac4d485d
2 changed files with 2 additions and 2 deletions

View File

@@ -652,7 +652,7 @@ impl<'a> BeMessage<'a> {
}
BeMessage::EncryptionResponse(should_negotiate) => {
let response = if *should_negotiate { b'Y' } else { b'N' };
let response = if *should_negotiate { b'S' } else { b'N' };
buf.put_u8(response);
}

View File

@@ -43,7 +43,7 @@ fn ssl() {
client_sock.write_u32::<BigEndian>(80877103).unwrap();
let ssl_response = client_sock.read_u8().unwrap();
assert_eq!(b'Y', ssl_response);
assert_eq!(b'S', ssl_response);
let mut cfg = rustls::ClientConfig::new();
cfg.root_store.add(&CERT).unwrap();