Skip to content

Instantly share code, notes, and snippets.

@pvdrz
Last active September 18, 2023 18:51
Show Gist options
  • Save pvdrz/c344683a50530e6d27ae1a50f067d2f8 to your computer and use it in GitHub Desktop.
Save pvdrz/c344683a50530e6d27ae1a50f067d2f8 to your computer and use it in GitHub Desktop.
client-cert-verification
Running `/home/christian/Workspace/ferrous-systems/rustls/rustls/target/debug/tl
sclient-mio --http --port 1443 --cafile /home/christian/.local/share/mkcert/rootCA.pe
m --auth-key localhost_client-client-key.pem --auth-certs localhost_client-client.pem
localhost`
ConnectionCore::for_client(server_name=DnsName("localhost"))
start_handshake(server_name=DnsName("localhost"))
emit_client_hello_for_retry()
CommonState::send_msg(m.typ=Handshake::ClientHello, must_encrypt=false)
CommonState::queue_tls_message(m.payload.len=231, m.typ=Handshake)
ChunkVecBuffer::append(bytes.len=236) <<<BUFFERING>>>
Writer::write(buf.len=81)
CommonState::send_some_plaintext(data.len=81)
CommonState::send_plain(data.len=81, limit=Yes)
ChunkVecBuffer::append_limited_copy(bytes.len=81) <<<BUFFERING>>>
ChunkVecBuffer::append(bytes.len=81) <<<BUFFERING>>>
ConnectionCommon::write_tls()
ChunkVecBuf::write_to() -> 236 <<<IO>>>
ConnectionCommon::read_tls()
MessageDeframer::read() -> 1839 <<<IO>>>
ConnectionCommon::process_new_packets()
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=122)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::ServerHello)
ExpectServerHelloOrHelloRetryRequest::handle(m.typ=Handshake::ServerHello)
ExpectServerHello::handle(m.typ=Handshake::ServerHello)
tls13::handle_server_hello
CommonState::send_msg(m.typ=ChangeCipherSpec, must_encrypt=false)
CommonState::queue_tls_message(m.payload.len=1, m.typ=ChangeCipherSpec)
ChunkVecBuffer::append(bytes.len=6) <<<BUFFERING>>>
ConnectionCore::process_msg(msg.typ=ChangeCipherSpec, msg.len=1)
RecordLayer::decrypt_incoming(encr.len=27) -> decr.len=10
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=10)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::EncryptedExtensions)
ExpectEncryptedExtensions::handle(m.typ=Handshake::EncryptedExtensions)
RecordLayer::decrypt_incoming(encr.len=185) -> decr.len=168
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=168)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::CertificateRequest)
ExpectCertificateOrCertReq::handle(m.typ=Handshake::CertificateRequest)
ExpectCertificateRequest::handle(m.typ=Handshake::CertificateRequest)
RecordLayer::decrypt_incoming(encr.len=1119) -> decr.len=1102
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=1102)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::Certificate)
ExpectCertificate::handle(m.typ=Handshake::Certificate)
RecordLayer::decrypt_incoming(encr.len=281) -> decr.len=264
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=264)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::CertificateVerify)
ExpectCertificateVerify::handle(m.typ=Handshake::CertificateVerify)
<dyn ServerCertVerifier>::verify_server_cert() <<<IO>>>
RecordLayer::decrypt_incoming(encr.len=69) -> decr.len=52
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=52)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::Finished)
ExpectFinished::handle(m.typ=Handshake::Finished)
CommonState::send_msg(m.typ=Handshake::Certificate, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=1118, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=1118) -> encr.len=1135
CommonState::queue_tls_message(m.payload.len=1135, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=1140) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Handshake::CertificateVerify, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=264, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=264) -> encr.len=281
CommonState::queue_tls_message(m.payload.len=281, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=286) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Handshake::Finished, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=52, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=52) -> encr.len=69
CommonState::queue_tls_message(m.payload.len=69, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=74) <<<BUFFERING>>>
CommonState::send_plain(data.len=81, limit=No)
CommonState::send_appdata_encrypt(payload.len=81, limit=No)
CommonState::send_single_frame(m.payload.len=81, m.typ=ApplicationData)
RecordLayer::encrypt_outgoing(plain.len=81) -> encr.len=98
CommonState::queue_tls_message(m.payload.len=98, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=103) <<<BUFFERING>>>
ConnectionCommon::write_tls()
ChunkVecBuf::write_to() -> 1609 <<<IO>>>
ConnectionCommon::read_tls()
MessageDeframer::read() -> 531 <<<IO>>>
ConnectionCommon::process_new_packets()
RecordLayer::decrypt_incoming(encr.len=98) -> decr.len=81
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=81)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::NewSessionTicket)
ExpectTraffic::handle(m.typ=Handshake::NewSessionTicket)
RecordLayer::decrypt_incoming(encr.len=98) -> decr.len=81
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=81)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::NewSessionTicket)
ExpectTraffic::handle(m.typ=Handshake::NewSessionTicket)
RecordLayer::decrypt_incoming(encr.len=98) -> decr.len=81
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=81)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::NewSessionTicket)
ExpectTraffic::handle(m.typ=Handshake::NewSessionTicket)
RecordLayer::decrypt_incoming(encr.len=98) -> decr.len=81
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=81)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::NewSessionTicket)
ExpectTraffic::handle(m.typ=Handshake::NewSessionTicket)
RecordLayer::decrypt_incoming(encr.len=90) -> decr.len=73
ConnectionCore::process_msg(msg.typ=ApplicationData, msg.len=73)
ConnectionCommon::process_main_protocol(msg.typ=ApplicationData)
ExpectTraffic::handle(m.typ=ApplicationData)
CommonState::take_received_plaintext(bytes.len=73)
ChunkVecBuffer::append(bytes.len=73) <<<BUFFERING>>>
RecordLayer::decrypt_incoming(encr.len=19) -> decr.len=2
ConnectionCore::process_msg(msg.typ=Alert, msg.len=2)
Reader::read(buf.len=73)
HTTP/1.0 200 OK
Connection: close
Hello world from rustls tlsserver
Connection closed
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Running `/home/christian/Workspace/ferrous-systems/rustls/rustls/target/debug/tl
sserver-mio --auth /home/christian/.local/share/mkcert/rootCA.pem --require-auth --ce
rts localhost.pem --key localhost-key.pem --port 1443 http`
ConnectionCommon::read_tls()
MessageDeframer::read() -> 236 <<<IO>>>
ConnectionCommon::process_new_packets()
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=231)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::ClientHello)
CommonState::send_msg(m.typ=Handshake::ServerHello, must_encrypt=false)
CommonState::queue_tls_message(m.payload.len=122, m.typ=Handshake)
ChunkVecBuffer::append(bytes.len=127) <<<BUFFERING>>>
CommonState::send_msg(m.typ=ChangeCipherSpec, must_encrypt=false)
CommonState::queue_tls_message(m.payload.len=1, m.typ=ChangeCipherSpec)
ChunkVecBuffer::append(bytes.len=6) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Handshake::EncryptedExtensions, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=10, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=10) -> encr.len=27
CommonState::queue_tls_message(m.payload.len=27, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=32) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Handshake::CertificateRequest, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=168, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=168) -> encr.len=185
CommonState::queue_tls_message(m.payload.len=185, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=190) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Handshake::Certificate, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=1102, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=1102) -> encr.len=1119
CommonState::queue_tls_message(m.payload.len=1119, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=1124) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Handshake::CertificateVerify, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=264, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=264) -> encr.len=281
CommonState::queue_tls_message(m.payload.len=281, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=286) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Handshake::Finished, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=52, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=52) -> encr.len=69
CommonState::queue_tls_message(m.payload.len=69, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=74) <<<BUFFERING>>>
ConnectionCommon::process_new_packets()
ConnectionCommon::write_tls()
ChunkVecBuf::write_to() -> 1839 <<<IO>>>
ConnectionCommon::read_tls()
MessageDeframer::read() -> 1609 <<<IO>>>
ConnectionCommon::process_new_packets()
ConnectionCore::process_msg(msg.typ=ChangeCipherSpec, msg.len=1)
RecordLayer::decrypt_incoming(encr.len=1135) -> decr.len=1118
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=1118)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::Certificate)
<dyn ClientCertVerifier>::verify_client_cert() <<<IO>>>
RecordLayer::decrypt_incoming(encr.len=281) -> decr.len=264
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=264)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::CertificateVerify)
RecordLayer::decrypt_incoming(encr.len=69) -> decr.len=52
ConnectionCore::process_msg(msg.typ=Handshake, msg.len=52)
ConnectionCommon::process_main_protocol(msg.typ=Handshake::Finished)
CommonState::send_msg(m.typ=Handshake::NewSessionTicket, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=81, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=81) -> encr.len=98
CommonState::queue_tls_message(m.payload.len=98, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=103) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Handshake::NewSessionTicket, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=81, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=81) -> encr.len=98
CommonState::queue_tls_message(m.payload.len=98, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=103) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Handshake::NewSessionTicket, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=81, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=81) -> encr.len=98
CommonState::queue_tls_message(m.payload.len=98, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=103) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Handshake::NewSessionTicket, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=81, m.typ=Handshake)
RecordLayer::encrypt_outgoing(plain.len=81) -> encr.len=98
CommonState::queue_tls_message(m.payload.len=98, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=103) <<<BUFFERING>>>
RecordLayer::decrypt_incoming(encr.len=98) -> decr.len=81
ConnectionCore::process_msg(msg.typ=ApplicationData, msg.len=81)
ConnectionCommon::process_main_protocol(msg.typ=ApplicationData)
CommonState::take_received_plaintext(bytes.len=81)
ChunkVecBuffer::append(bytes.len=81) <<<BUFFERING>>>
ConnectionCommon::process_new_packets()
Reader::read(buf.len=81)
Writer::write(buf.len=73)
CommonState::send_some_plaintext(data.len=73)
CommonState::send_plain(data.len=73, limit=Yes)
CommonState::send_appdata_encrypt(payload.len=73, limit=Yes)
CommonState::send_single_frame(m.payload.len=73, m.typ=ApplicationData)
RecordLayer::encrypt_outgoing(plain.len=73) -> encr.len=90
CommonState::queue_tls_message(m.payload.len=90, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=95) <<<BUFFERING>>>
CommonState::send_msg(m.typ=Alert, must_encrypt=true)
CommonState::send_single_frame(m.payload.len=2, m.typ=Alert)
RecordLayer::encrypt_outgoing(plain.len=2) -> encr.len=19
CommonState::queue_tls_message(m.payload.len=19, m.typ=ApplicationData)
ChunkVecBuffer::append(bytes.len=24) <<<BUFFERING>>>
ConnectionCommon::write_tls()
ChunkVecBuf::write_to() -> 531 <<<IO>>>
ConnectionCommon::read_tls()
MessageDeframer::read() -> 0 <<<IO>>>
ConnectionCommon::process_new_packets()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment