update comments

This commit is contained in:
yggverse 2024-11-21 22:21:43 +02:00
parent e1b2a2b3d2
commit 182d705960

View File

@ -435,7 +435,11 @@ impl Page {
let tls_connection = let tls_connection =
TlsClientConnection::new(&connection, Some(&connectable)).unwrap(); // @TODO handle TlsClientConnection::new(&connection, Some(&connectable)).unwrap(); // @TODO handle
tls_connection.set_certificate(&certificate); tls_connection.set_certificate(&certificate);
tls_connection.connect_accept_certificate(move |_, _, _| true); // @TODO manual validation
// @TODO manual validation
// https://geminiprotocol.net/docs/protocol-specification.gmi#tls-server-certificate-validation
tls_connection.connect_accept_certificate(move |_, _, _| true);
tls_connection.upcast::<IOStream>() tls_connection.upcast::<IOStream>()
} else { } else {
connection.upcast::<IOStream>() connection.upcast::<IOStream>()
@ -487,14 +491,13 @@ impl Page {
SocketClientEvent::ProxyNegotiating => Status::ProxyNegotiating, SocketClientEvent::ProxyNegotiating => Status::ProxyNegotiating,
SocketClientEvent::ProxyNegotiated => Status::ProxyNegotiated, SocketClientEvent::ProxyNegotiated => Status::ProxyNegotiated,
SocketClientEvent::TlsHandshaking => { SocketClientEvent::TlsHandshaking => {
// Handle certificate errors here // Handle certificate errors @TODO
// https://geminiprotocol.net/docs/protocol-specification.gmi#tls-server-certificate-validation
stream stream
.unwrap() .unwrap()
.dynamic_cast_ref::<TlsClientConnection>() .dynamic_cast_ref::<TlsClientConnection>()
.unwrap() .unwrap()
.connect_accept_certificate(|_, _, _| { .connect_accept_certificate(|_, _, _| true);
true // @TODO
});
Status::TlsHandshaking Status::TlsHandshaking
} }
SocketClientEvent::TlsHandshaked => Status::TlsHandshaked, SocketClientEvent::TlsHandshaked => Status::TlsHandshaked,