@@ -19,10 +19,10 @@ use bitcoin::consensus::encode::deserialize;
1919use bitcoin:: hex:: { DisplayHex , FromHex } ;
2020use bitcoin:: { Script , Txid } ;
2121
22- #[ cfg( feature = "use- openssl" ) ]
22+ #[ cfg( feature = "openssl" ) ]
2323use openssl:: ssl:: { SslConnector , SslMethod , SslStream , SslVerifyMode } ;
2424
25- #[ cfg( any( feature = "use- rustls" , feature = "use- rustls-ring" ) ) ]
25+ #[ cfg( any( feature = "rustls" , feature = "rustls-ring" ) ) ]
2626#[ allow( unused_imports) ]
2727use rustls:: {
2828 pki_types:: ServerName ,
@@ -222,10 +222,10 @@ fn connect_with_total_timeout<A: ToSocketAddrs>(
222222 Err ( Error :: AllAttemptsErrored ( errors) )
223223}
224224
225- #[ cfg( feature = "use- openssl" ) ]
225+ #[ cfg( feature = "openssl" ) ]
226226/// Transport type used to establish an OpenSSL TLS encrypted/authenticated connection with the server
227227pub type ElectrumSslStream = SslStream < TcpStream > ;
228- #[ cfg( feature = "use- openssl" ) ]
228+ #[ cfg( feature = "openssl" ) ]
229229impl RawClient < ElectrumSslStream > {
230230 /// Creates a new SSL client and tries to connect to `socket_addr`. Optionally, if
231231 /// `validate_domain` is `true`, validate the server's certificate.
@@ -283,7 +283,7 @@ impl RawClient<ElectrumSslStream> {
283283 }
284284}
285285
286- #[ cfg( any( feature = "use- rustls" , feature = "use- rustls-ring" ) ) ]
286+ #[ cfg( any( feature = "rustls" , feature = "rustls-ring" ) ) ]
287287#[ allow( unused) ]
288288mod danger {
289289 use crate :: raw_client:: ServerName ;
@@ -338,14 +338,14 @@ mod danger {
338338}
339339
340340#[ cfg( all(
341- any( feature = "use- rustls" , feature = "use- rustls-ring" ) ,
342- not( feature = "use- openssl" )
341+ any( feature = "rustls" , feature = "rustls-ring" ) ,
342+ not( feature = "openssl" )
343343) ) ]
344344/// Transport type used to establish a Rustls TLS encrypted/authenticated connection with the server
345345pub type ElectrumSslStream = StreamOwned < ClientConnection , TcpStream > ;
346346#[ cfg( all(
347- any( feature = "use- rustls" , feature = "use- rustls-ring" ) ,
348- not( feature = "use- openssl" )
347+ any( feature = "rustls" , feature = "rustls-ring" ) ,
348+ not( feature = "openssl" )
349349) ) ]
350350impl RawClient < ElectrumSslStream > {
351351 /// Creates a new SSL client and tries to connect to `socket_addr`. Optionally, if
@@ -388,7 +388,7 @@ impl RawClient<ElectrumSslStream> {
388388
389389 if rustls:: crypto:: CryptoProvider :: get_default ( ) . is_none ( ) {
390390 // We install a crypto provider depending on the set feature.
391- #[ cfg( all( feature = "use- rustls" , not( feature = "use- rustls-ring" ) ) ) ]
391+ #[ cfg( all( feature = "rustls" , not( feature = "rustls-ring" ) ) ) ]
392392 rustls:: crypto:: CryptoProvider :: install_default (
393393 rustls:: crypto:: aws_lc_rs:: default_provider ( ) ,
394394 )
@@ -398,7 +398,7 @@ impl RawClient<ElectrumSslStream> {
398398 ) )
399399 } ) ?;
400400
401- #[ cfg( feature = "use- rustls-ring" ) ]
401+ #[ cfg( feature = "rustls-ring" ) ]
402402 rustls:: crypto:: CryptoProvider :: install_default (
403403 rustls:: crypto:: ring:: default_provider ( ) ,
404404 )
@@ -429,9 +429,9 @@ impl RawClient<ElectrumSslStream> {
429429 builder
430430 . dangerous ( )
431431 . with_custom_certificate_verifier ( std:: sync:: Arc :: new (
432- #[ cfg( all( feature = "use- rustls" , not( feature = "use- rustls-ring" ) ) ) ]
432+ #[ cfg( all( feature = "rustls" , not( feature = "rustls-ring" ) ) ) ]
433433 danger:: NoCertificateVerification :: new ( rustls:: crypto:: aws_lc_rs:: default_provider ( ) ) ,
434- #[ cfg( feature = "use- rustls-ring" ) ]
434+ #[ cfg( feature = "rustls-ring" ) ]
435435 danger:: NoCertificateVerification :: new ( rustls:: crypto:: ring:: default_provider ( ) ) ,
436436 ) )
437437 . with_no_client_auth ( )
@@ -480,11 +480,7 @@ impl RawClient<ElectrumProxyStream> {
480480 }
481481
482482 #[ cfg( all(
483- any(
484- feature = "use-openssl" ,
485- feature = "use-rustls" ,
486- feature = "use-rustls-ring" ,
487- ) ,
483+ any( feature = "openssl" , feature = "rustls" , feature = "rustls-ring" , ) ,
488484 feature = "proxy" ,
489485 ) ) ]
490486 /// Creates a new TLS client that connects to `target_addr` using `proxy_addr` as a socks proxy
0 commit comments