mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
move guest certificate validator to ggemini library, keep status updates only
This commit is contained in:
parent
2fabc6b38e
commit
36f07aa773
@ -23,12 +23,12 @@ use crate::Profile;
|
|||||||
use gtk::{
|
use gtk::{
|
||||||
gdk::Texture,
|
gdk::Texture,
|
||||||
gdk_pixbuf::Pixbuf,
|
gdk_pixbuf::Pixbuf,
|
||||||
gio::{Cancellable, SocketClientEvent, TlsCertificate, TlsClientConnection},
|
gio::{Cancellable, SocketClientEvent, TlsCertificate},
|
||||||
glib::{
|
glib::{
|
||||||
gformat, GString, Priority, Regex, RegexCompileFlags, RegexMatchFlags, Uri, UriFlags,
|
gformat, GString, Priority, Regex, RegexCompileFlags, RegexMatchFlags, Uri, UriFlags,
|
||||||
UriHideFlags,
|
UriHideFlags,
|
||||||
},
|
},
|
||||||
prelude::{CancellableExt, Cast, EditableExt, SocketClientExt, TlsConnectionExt},
|
prelude::{CancellableExt, EditableExt, SocketClientExt},
|
||||||
};
|
};
|
||||||
use sqlite::Transaction;
|
use sqlite::Transaction;
|
||||||
use std::{cell::RefCell, rc::Rc, time::Duration};
|
use std::{cell::RefCell, rc::Rc, time::Duration};
|
||||||
@ -436,7 +436,7 @@ impl Page {
|
|||||||
let id = id.clone();
|
let id = id.clone();
|
||||||
let meta = meta.clone();
|
let meta = meta.clone();
|
||||||
let update = update.clone();
|
let update = update.clone();
|
||||||
move |_, event, _, stream| {
|
move |_, event, _, _| {
|
||||||
meta.set_status(match event {
|
meta.set_status(match event {
|
||||||
SocketClientEvent::Resolving => Status::Resolving,
|
SocketClientEvent::Resolving => Status::Resolving,
|
||||||
SocketClientEvent::Resolved => Status::Resolved,
|
SocketClientEvent::Resolved => Status::Resolved,
|
||||||
@ -444,17 +444,8 @@ impl Page {
|
|||||||
SocketClientEvent::Connected => Status::Connected,
|
SocketClientEvent::Connected => Status::Connected,
|
||||||
SocketClientEvent::ProxyNegotiating => Status::ProxyNegotiating,
|
SocketClientEvent::ProxyNegotiating => Status::ProxyNegotiating,
|
||||||
SocketClientEvent::ProxyNegotiated => Status::ProxyNegotiated,
|
SocketClientEvent::ProxyNegotiated => Status::ProxyNegotiated,
|
||||||
// This match have effect only for unauthorized (random) TLS connection
|
// TlsHandshaking have effect only for guest connections!
|
||||||
SocketClientEvent::TlsHandshaking => {
|
SocketClientEvent::TlsHandshaking => Status::TlsHandshaking,
|
||||||
// Handle certificate errors @TODO
|
|
||||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#tls-server-certificate-validation
|
|
||||||
stream
|
|
||||||
.unwrap()
|
|
||||||
.dynamic_cast_ref::<TlsClientConnection>()
|
|
||||||
.unwrap()
|
|
||||||
.connect_accept_certificate(|_, _, _| true);
|
|
||||||
Status::TlsHandshaking
|
|
||||||
}
|
|
||||||
SocketClientEvent::TlsHandshaked => Status::TlsHandshaked,
|
SocketClientEvent::TlsHandshaked => Status::TlsHandshaked,
|
||||||
SocketClientEvent::Complete => Status::Complete,
|
SocketClientEvent::Complete => Status::Complete,
|
||||||
_ => todo!(), // notice on API change
|
_ => todo!(), // notice on API change
|
||||||
|
Loading…
x
Reference in New Issue
Block a user