From 82cfb46bd1d64d41afda544bde9ef57096fb520b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 22 Sep 2021 11:12:08 +0200 Subject: chore(ext/net): improve embedder friendliness (#12178) Default to None if UnsafelyIgnoreCertificateErrors is not present in the OpState. Embedders may not have a need for restricting outgoing TLS connections and having them hunt through the source code for the magic incantation that makes the borrow panics go away, is less user friendly. --- ext/websocket/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ext/websocket/lib.rs') diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs index c75fa1742..f9f11e591 100644 --- a/ext/websocket/lib.rs +++ b/ext/websocket/lib.rs @@ -224,9 +224,8 @@ where let unsafely_ignore_certificate_errors = state .borrow() - .borrow::() - .0 - .clone(); + .try_borrow::() + .and_then(|it| it.0.clone()); let root_cert_store = state.borrow().borrow::().0.clone(); let user_agent = state.borrow().borrow::().0.clone(); let uri: Uri = args.url.parse()?; -- cgit v1.2.3