Skip to content

Commit

Permalink
Fix compiling with urlspec, but not tls feature
Browse files Browse the repository at this point in the history
  • Loading branch information
tyilo committed Jan 25, 2024
1 parent 683b675 commit 98dc2a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion amqprs/src/api/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,14 @@ impl TryFrom<&str> for OpenConnectionArguments {
args.heartbeat(heartbeat);

if scheme == AMQPS_SCHEME {
#[cfg(feature = "tls")]
args.tls_adaptor(
TlsAdaptor::without_client_auth(None, host.to_string())
.map_err(|e| Error::UriError(format!("Error creating TLS adaptor: {}", e)))?,
.map_err(|e| Error::UriError(format!("error creating TLS adaptor: {}", e)))?,
);

#[cfg(not(feature = "tls"))]
return Err(Error::UriError("can't create amqps url without the `tls` feature enabled".to_string()));
}

Ok(args)
Expand Down

0 comments on commit 98dc2a4

Please sign in to comment.