mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
use native TlsCertificate
This commit is contained in:
parent
27371d3510
commit
ceffee5761
@ -23,7 +23,7 @@ use crate::Profile;
|
|||||||
use gtk::{
|
use gtk::{
|
||||||
gdk::Texture,
|
gdk::Texture,
|
||||||
gdk_pixbuf::Pixbuf,
|
gdk_pixbuf::Pixbuf,
|
||||||
gio::{Cancellable, SocketClientEvent},
|
gio::{Cancellable, SocketClientEvent, TlsCertificate},
|
||||||
glib::{
|
glib::{
|
||||||
gformat, GString, Priority, Regex, RegexCompileFlags, RegexMatchFlags, Uri, UriFlags,
|
gformat, GString, Priority, Regex, RegexCompileFlags, RegexMatchFlags, Uri, UriFlags,
|
||||||
UriHideFlags,
|
UriHideFlags,
|
||||||
@ -401,22 +401,6 @@ impl Page {
|
|||||||
let input = self.input.clone();
|
let input = self.input.clone();
|
||||||
let meta = self.meta.clone();
|
let meta = self.meta.clone();
|
||||||
|
|
||||||
// Find identity match request
|
|
||||||
let certificate = match self
|
|
||||||
.profile
|
|
||||||
.identity
|
|
||||||
.gemini
|
|
||||||
.match_priority(&self.navigation.request.widget.entry.text())
|
|
||||||
{
|
|
||||||
Some(identity) => {
|
|
||||||
match gemini::client::Certificate::from_pem(&identity.pem, &identity.scope) {
|
|
||||||
Ok(certificate) => Some(certificate),
|
|
||||||
Err(reason) => todo!("{reason}"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None => None,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Listen for connection status updates
|
// Listen for connection status updates
|
||||||
self.client.gemini.socket.connect_event({
|
self.client.gemini.socket.connect_event({
|
||||||
let id = id.clone();
|
let id = id.clone();
|
||||||
@ -445,7 +429,13 @@ impl Page {
|
|||||||
uri.clone(),
|
uri.clone(),
|
||||||
None,
|
None,
|
||||||
Some(cancellable.clone()),
|
Some(cancellable.clone()),
|
||||||
certificate,
|
match self.profile.identity.gemini.match_priority(&self.navigation.request.widget.entry.text()) {
|
||||||
|
Some(identity) => match TlsCertificate::from_pem(&identity.pem) {
|
||||||
|
Ok(certificate) => Some(certificate),
|
||||||
|
Err(reason) => todo!("{reason}"),
|
||||||
|
},
|
||||||
|
None => None,
|
||||||
|
},
|
||||||
move |result| match result {
|
move |result| match result {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
// Route by status
|
// Route by status
|
||||||
|
Loading…
x
Reference in New Issue
Block a user