Unacceptable TLS certificate

I use self-signed certificate with TlsClientConnection wrapper, after upgrade to gnome 47 dependencies, it give an exception in subject. Not sure when it happened, everything worked before, maybe I can’t use self-signed certificates anymore?

Since 2.72 set_tls_validation_flags marked as deprecated also

client.set_tls_validation_flags(TlsCertificateFlags::INSECURE);

Any ideas?

Well, the solution is drop deprecated set_tls_validation_flags method and handle certificate errors manually:

connection.connect_accept_certificate(|_, _, _| {
    true // handle
});

or

socket_client.connect_event({
    |_, event, _, stream| {
        match event {
            SocketClientEvent::TlsHandshaking => {
                // Handle certificate errors here
                stream
                    .unwrap()
                    .dynamic_cast_ref::<TlsClientConnection>()
                    .unwrap()
                    .connect_accept_certificate(|_, _, _| {
                        true // | false
                    });
            }
            // ..

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.