diff options
Diffstat (limited to 'ext/net/ops_tls.rs')
-rw-r--r-- | ext/net/ops_tls.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/net/ops_tls.rs b/ext/net/ops_tls.rs index ac9c80f7a..7b1cb4e0a 100644 --- a/ext/net/ops_tls.rs +++ b/ext/net/ops_tls.rs @@ -1055,7 +1055,13 @@ where .with_safe_defaults() .with_no_client_auth() .with_single_cert(cert_chain, key_der) - .expect("invalid key or certificate"); + .map_err(|e| { + custom_error( + "InvalidData", + format!("Error creating TLS certificate: {:?}", e), + ) + })?; + if let Some(alpn_protocols) = args.alpn_protocols { tls_config.alpn_protocols = alpn_protocols.into_iter().map(|s| s.into_bytes()).collect(); |