Skip to content

Instantly share code, notes, and snippets.

View maspetsberger's full-sized avatar

Michael Aspetsberger maspetsberger

View GitHub Profile
@maspetsberger
maspetsberger / main.rs
Created April 15, 2022 15:24
Skipping certificate verification for e.g. self-signed or outdated certificats in rust using rustls and ureq.
use std::sync::Arc;
use ureq::*;
/// Creates a new accept anything verifier.
/// WARNING: Do not use in production!
fn make_verifier() -> impl rustls::client::ServerCertVerifier {
struct V();
impl rustls::client::ServerCertVerifier for V {
fn verify_server_cert(
&self,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.